diff --git a/schala-lang/language/src/scope_resolution.rs b/schala-lang/language/src/scope_resolution.rs index da046e4..1734b9b 100644 --- a/schala-lang/language/src/scope_resolution.rs +++ b/schala-lang/language/src/scope_resolution.rs @@ -94,25 +94,26 @@ impl ScopeResolver { }, Literal(_) => (), TupleStruct(name, patterns) => { - self.qualified_name(name); + self.qualified_name_in_pattern(name); for pat in patterns { self.pattern(pat)?; } }, Record(name, key_patterns) => { - self.qualified_name(name); + self.qualified_name_in_pattern(name); for (_, pat) in key_patterns { self.pattern(pat)?; } }, VarOrName(name) => { - self.qualified_name(name); + self.qualified_name_in_pattern(name); }, }; Ok(()) } - fn qualified_name(&mut self, meta_qualified_name: &mut Meta, ) { + /// this might be a variable or a pattern. if a variable, set to none + fn qualified_name_in_pattern(&mut self, meta_qualified_name: &mut Meta, ) { let inner_name = meta_qualified_name.node(); let fqsn = lookup_name_in_scope(inner_name); meta_qualified_name.fqsn = Some(fqsn);