mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 18:41:03 +01:00
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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user