Assign a constant to ClassDecl/InterfaceDecl for name references. (#3722)

By adding a constant to ClassDecl/InterfaceDecl, we're able to remove
name reference special-casing. Use TryEvalInst on the Decl to generate
the Type. For ClassDecl, then use the generated constant for
self_type_id.
This commit is contained in:
Jon Ross-Perkins
2024-02-24 00:00:18 +00:00
committed by GitHub
parent 8e8eeb3243
commit 364ea5d3f2
109 changed files with 420 additions and 429 deletions
+2 -2
View File
@@ -51,8 +51,8 @@ static auto BuildInterfaceDecl(Context& context,
auto decl_block_id = context.inst_block_stack().Pop();
// Add the interface declaration.
auto interface_decl =
SemIR::InterfaceDecl{SemIR::InterfaceId::Invalid, decl_block_id};
auto interface_decl = SemIR::InterfaceDecl{
SemIR::TypeId::TypeType, SemIR::InterfaceId::Invalid, decl_block_id};
auto interface_decl_id =
context.AddPlaceholderInst({parse_node, interface_decl});