mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-06 06:54:44 +01:00
Preserve ErrorInst in TryGetTypeIdForTypeConstantId (#7079)
An ErrorInst::ConstantId constant can be used as a type, and should result in an ErrorInst::TypeId
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user