Make higher levels adapt Bodys exprs having ExprOrPatId values

This commit is contained in:
Ali Bektas 2025-01-08 00:26:47 +01:00
parent 06097c3388
commit d8779b4a0e
8 changed files with 32 additions and 33 deletions

View file

@ -142,7 +142,7 @@ impl SourceAnalyzer {
fn pat_id(&self, pat: &ast::Pat) -> Option<PatId> {
// FIXME: macros, see `expr_id`
let src = InFile { file_id: self.file_id, value: pat };
self.body_source_map()?.node_pat(src)
self.body_source_map()?.node_pat(src).and_then(ExprOrPatId::as_pat)
}
fn binding_id_of_pat(&self, pat: &ast::IdentPat) -> Option<BindingId> {