mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Lower FacetType to TypeType to match FacetValue lowering (#7734)
SemIR::FacetValue lowers to context.GetTypeAsValue(), which produces a
constant of LLVM type %type (context.GetTypeType()). However,
SemIR::FacetType previously fell back to an anonymous empty struct {},
causing an argument type mismatch assertion failure when passing a
FacetValue to a function expecting a FacetType parameter.
Identified by @danakj in #7731
Assisted-by: Antigravity with Gemini
This commit is contained in:
@@ -802,7 +802,9 @@ static auto BuildTypeForInst(FileContext& context, SemIR::TupleType inst)
|
||||
return BuildStructType(context, subtypes, layouts);
|
||||
}
|
||||
|
||||
static auto BuildTypeForInst(FileContext& context, SemIR::TypeType /*inst*/)
|
||||
template <typename InstT>
|
||||
requires(InstT::Kind.template IsAnyOf<SemIR::FacetType, SemIR::TypeType>())
|
||||
static auto BuildTypeForInst(FileContext& context, InstT /*inst*/)
|
||||
-> LoweredTypes {
|
||||
return {context.GetTypeType(), nullptr};
|
||||
}
|
||||
@@ -821,11 +823,11 @@ template <typename InstT>
|
||||
requires(InstT::Kind.template IsAnyOf<
|
||||
SemIR::AssociatedEntityType, SemIR::AutoType, SemIR::BoundMethodType,
|
||||
SemIR::CharLiteralType, SemIR::CppOverloadSetType,
|
||||
SemIR::CppTemplateNameType, SemIR::FacetType,
|
||||
SemIR::FloatLiteralType, SemIR::FunctionType,
|
||||
SemIR::FunctionTypeWithSelfType, SemIR::GenericClassType,
|
||||
SemIR::GenericInterfaceType, SemIR::GenericNamedConstraintType,
|
||||
SemIR::InstType, SemIR::IntLiteralType, SemIR::NamespaceType,
|
||||
SemIR::CppTemplateNameType, SemIR::FloatLiteralType,
|
||||
SemIR::FunctionType, SemIR::FunctionTypeWithSelfType,
|
||||
SemIR::GenericClassType, SemIR::GenericInterfaceType,
|
||||
SemIR::GenericNamedConstraintType, SemIR::InstType,
|
||||
SemIR::IntLiteralType, SemIR::NamespaceType,
|
||||
SemIR::RequireSpecificDefinitionType, SemIR::SpecificFunctionType,
|
||||
SemIR::UnboundElementType, SemIR::WhereExpr, SemIR::WitnessType>())
|
||||
static auto BuildTypeForInst(FileContext& context, InstT /*inst*/)
|
||||
|
||||
Reference in New Issue
Block a user