瀏覽代碼

Preserve ErrorInst in TryGetTypeIdForTypeConstantId (#7079)

An ErrorInst::ConstantId constant can be used as a type, and should
result in an ErrorInst::TypeId
Dana Jansens 1 周之前
父節點
當前提交
5e2f693db1
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      toolchain/sem_ir/type.cpp

+ 1 - 1
toolchain/sem_ir/type.cpp

@@ -35,7 +35,7 @@ auto TypeStore::GetTypeIdForTypeConstantId(ConstantId constant_id) const
 auto TypeStore::TryGetTypeIdForTypeConstantId(ConstantId constant_id) const
     -> TypeId {
   if (constant_id == SemIR::ErrorInst::ConstantId) {
-    return TypeId::None;
+    return SemIR::ErrorInst::TypeId;
   }
   auto type_id = file_->insts()
                      .Get(file_->constant_values().GetInstId(constant_id))