|
|
@@ -294,11 +294,22 @@ class Context {
|
|
|
return scope_stack().GetCurrentScopeAs<InstT>(sem_ir());
|
|
|
}
|
|
|
|
|
|
- // Returns the type ID for a constant of type `type`.
|
|
|
+ // Returns the type ID for a constant that is a type value, i.e. it is a value
|
|
|
+ // of type `TypeType`.
|
|
|
+ //
|
|
|
+ // Facet values are of the same typishness as types, but are not themselves
|
|
|
+ // types, so they can not be passed here. They should be converted to a type
|
|
|
+ // through an `as type` conversion, that is, to a value of type `TypeType`.
|
|
|
auto GetTypeIdForTypeConstant(SemIR::ConstantId constant_id) -> SemIR::TypeId;
|
|
|
|
|
|
- // Returns the type ID for an instruction whose constant value is of type
|
|
|
- // `type`.
|
|
|
+ // Returns the type ID for an instruction whose constant value is a type
|
|
|
+ // value, i.e. it is a value of type `TypeType`.
|
|
|
+ //
|
|
|
+ // Instructions whose values are facet values (see `FacetValue`) produce a
|
|
|
+ // value of the same typishness as types, but which are themselves not types,
|
|
|
+ // so they can not be passed here. They should be converted to a type through
|
|
|
+ // an `as type` conversion, such as to a `FacetAccessType` instruction whose
|
|
|
+ // value is of type `TypeType`.
|
|
|
auto GetTypeIdForTypeInst(SemIR::InstId inst_id) -> SemIR::TypeId {
|
|
|
return GetTypeIdForTypeConstant(constant_values().Get(inst_id));
|
|
|
}
|