mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-06 08:54:47 +01:00
Replace GetTypeInSpecific with GetTypeOfInstInSpecific. (#5232)
Reduce usage of `GetConstantInSpecific` to a single caller in constant evaluation, with a TODO to remove that. This gets us closer to being able to fully perform type-checking against abstract types instead of types anchored within a particular generic.
This commit is contained in:
@@ -261,10 +261,11 @@ static auto LookupMemberNameInScope(Context& context, SemIR::LocId loc_id,
|
||||
}
|
||||
|
||||
// TODO: This duplicates the work that HandleNameAsExpr does. Factor this out.
|
||||
auto inst = context.insts().Get(result.scope_result.target_inst_id());
|
||||
auto type_id = SemIR::GetTypeInSpecific(context.sem_ir(), result.specific_id,
|
||||
inst.type_id());
|
||||
CARBON_CHECK(type_id.has_value(), "Missing type for member {0}", inst);
|
||||
auto type_id =
|
||||
SemIR::GetTypeOfInstInSpecific(context.sem_ir(), result.specific_id,
|
||||
result.scope_result.target_inst_id());
|
||||
CARBON_CHECK(type_id.has_value(), "Missing type for member {0}",
|
||||
context.insts().Get(result.scope_result.target_inst_id()));
|
||||
|
||||
// If the named entity has a constant value that depends on its specific,
|
||||
// store the specific too.
|
||||
|
||||
Reference in New Issue
Block a user