Fix incorrect application of invalid type on imports. (#3902)

In handle_class and handle_interface we assign TypeType, so is more
consistent. I think this had been missed because we haven't really been
using these declarations (historically, declarations didn't have a
type). It seems not to significantly affect output at present, although
I found this while trying to change merge behavior.
This commit is contained in:
Jon Ross-Perkins
2024-04-22 20:34:27 +00:00
committed by GitHub
parent 280a25b863
commit 76a5cf5f50
35 changed files with 85 additions and 85 deletions
+2 -2
View File
@@ -542,7 +542,7 @@ class ImportRefResolver {
auto MakeIncompleteClass(const SemIR::Class& import_class)
-> SemIR::ConstantId {
auto class_decl =
SemIR::ClassDecl{SemIR::TypeId::Invalid, SemIR::ClassId::Invalid,
SemIR::ClassDecl{SemIR::TypeId::TypeType, SemIR::ClassId::Invalid,
SemIR::InstBlockId::Empty};
auto class_decl_id =
context_.AddPlaceholderInst(SemIR::LocIdAndInst::Untyped(
@@ -788,7 +788,7 @@ class ImportRefResolver {
// importing the interface definition in order to resolve cycles.
auto MakeInterfaceDecl(const SemIR::Interface& import_interface)
-> SemIR::ConstantId {
auto interface_decl = SemIR::InterfaceDecl{SemIR::TypeId::Invalid,
auto interface_decl = SemIR::InterfaceDecl{SemIR::TypeId::TypeType,
SemIR::InterfaceId::Invalid,
SemIR::InstBlockId::Empty};
auto interface_decl_id =