mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-18 20:00:29 +00: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:
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);
|
||||
|
||||
|
||||
Reference in new issue
Block a user