Handle semantic name lookup for function parameters. (#2839)

I'm adding a separate function for this instead of adding a bool to AddToNameLookup because this way I don't need to pass in a parse node.
This commit is contained in:
Jon Ross-Perkins authored and GitHub committed 2023-05-23 10:47:27 -07:00
1 parent 98105a23b4
commit bd4e22001f
5 files changed
+54 -30

No files matched your search

@@ -58,6 +58,11 @@ auto SemanticsHandleFunctionDefinitionStart(SemanticsContext& context,
context.node_block_stack().Push();
context.PushScope();
for (auto ref_id : context.semantics().GetNodeBlock(param_refs_id)) {
auto ref = context.semantics().GetNode(ref_id);
auto [name_id, target_id] = ref.GetAsBindName();
context.AddNameToLookupIgnoreConflicts(name_id, target_id);
}
context.return_scope_stack().push_back(decl_id);
context.node_stack().Push(parse_node, decl_id);