mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +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:
@@ -109,10 +109,10 @@ static auto HandleNameAsExpr(Context& context, Parse::NodeId node_id,
|
||||
SemIR::NameId name_id) -> SemIR::InstId {
|
||||
auto result = LookupUnqualifiedName(context, node_id, name_id);
|
||||
SemIR::InstId inst_id = result.scope_result.target_inst_id();
|
||||
auto value = context.insts().Get(inst_id);
|
||||
auto type_id = SemIR::GetTypeInSpecific(context.sem_ir(), result.specific_id,
|
||||
value.type_id());
|
||||
CARBON_CHECK(type_id.has_value(), "Missing type for {0}", value);
|
||||
auto type_id = SemIR::GetTypeOfInstInSpecific(context.sem_ir(),
|
||||
result.specific_id, inst_id);
|
||||
CARBON_CHECK(type_id.has_value(), "Missing type for {0}",
|
||||
context.insts().Get(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