Fix handling of member types of generic classes. (#5332)

Instead of evaluating a non-parameterized class or interface to a
constant with `SpecificId::None`, use the self specific for that class
or interface, which will not be `None` if there is an enclosing generic.
This commit is contained in:
Richard Smith
2025-04-18 15:09:50 +00:00
committed by GitHub
parent 9a6c74f0cd
commit 89c9714825
11 changed files with 1013 additions and 132 deletions
+1 -1
View File
@@ -1674,7 +1674,7 @@ static auto ComputeInstPhase(Context& context, SemIR::Inst inst) -> Phase {
context.types().GetConstantId(inst.type_id()));
GetConstantValueForArg(eval_context, inst.arg0_and_kind(), &phase);
GetConstantValueForArg(eval_context, inst.arg1_and_kind(), &phase);
CARBON_CHECK(IsConstant(phase));
CARBON_CHECK(phase != Phase::Runtime);
return phase;
}