When performing name lookup, determine the generic instance within which the lookup result was found. (#4118)

Require types into which qualified lookup is performed to be completely
defined. Eventually this will trigger substitution into the definition
for generic types.
This commit is contained in:
Richard Smith
2024-07-10 18:35:55 +00:00
committed by GitHub
parent a4ef5dd591
commit 6d3c915bbf
20 changed files with 422 additions and 89 deletions
+7
View File
@@ -281,6 +281,13 @@ auto GetConstantInInstance(Context& context,
return context.constant_values().Get(symbolic.inst_id);
}
auto GetConstantValueInInstance(Context& context,
SemIR::GenericInstanceId instance_id,
SemIR::InstId inst_id) -> SemIR::ConstantId {
return GetConstantInInstance(context, instance_id,
context.constant_values().Get(inst_id));
}
auto GetTypeInInstance(Context& context, SemIR::GenericInstanceId instance_id,
SemIR::TypeId type_id) -> SemIR::TypeId {
auto const_id = context.types().GetConstantId(type_id);