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