Refactor name addition, particularly for associated entities. (#3924)

This is so that the constant associated with a function is used after
the function declaration is complete, related to changing how function
constants work.
This commit is contained in:
Jon Ross-Perkins
2024-05-01 00:59:18 +00:00
committed by GitHub
parent 4f2bd0b095
commit f9a4371aca
7 changed files with 88 additions and 52 deletions
+1 -1
View File
@@ -435,7 +435,7 @@ auto HandleBaseDecl(Context& context, Parse::BaseDeclId node_id) -> bool {
SemIR::StructTypeField{SemIR::NameId::Base, base_info.type_id}}));
// Bind the name `base` in the class to the base field.
context.decl_name_stack().AddNameToLookup(
context.decl_name_stack().AddNameOrDiagnoseDuplicate(
context.decl_name_stack().MakeUnqualifiedName(node_id,
SemIR::NameId::Base),
class_info.base_id);