mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-06 06:54:44 +01:00
Store an InstId instead of a TypeId in UnboundElementType. (#5260)
This gives a slightly simpler representation for `UnboundElementType`s in eval blocks, and in principle allows us to preserve the spelling of a field's type into the `UnboundElementType` and thereby into a field reference, although as of right now this doesn't affect our diagnostic output in any way. During error recovery for a field with a non-concrete type, preserve the type in the `UnboundElementType` regardless. It's not really problematic to have a non-concrete type there, and this makes it easier to track the instruction used to specify the type. This is a step towards switching symbolic types to always be abstract during type checking.
This commit is contained in:
@@ -157,8 +157,8 @@ auto GetPointerType(Context& context, SemIR::InstId pointee_type_id)
|
||||
return GetTypeImpl<SemIR::PointerType>(context, pointee_type_id);
|
||||
}
|
||||
|
||||
auto GetUnboundElementType(Context& context, SemIR::TypeId class_type_id,
|
||||
SemIR::TypeId element_type_id) -> SemIR::TypeId {
|
||||
auto GetUnboundElementType(Context& context, SemIR::InstId class_type_id,
|
||||
SemIR::InstId element_type_id) -> SemIR::TypeId {
|
||||
return GetTypeImpl<SemIR::UnboundElementType>(context, class_type_id,
|
||||
element_type_id);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user