Skip to content

Commit 354a194

Browse files
committed
IRGen: Use mapConformanceRefIntoContext() in OpaqueTypeDescriptorBuilder
1 parent 2c1297e commit 354a194

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

lib/IRGen/GenMeta.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2715,20 +2715,18 @@ namespace {
27152715
auto underlyingDependentType = R.getFirstType()->getCanonicalType();
27162716

27172717
auto underlyingType =
2718-
underlyingDependentType.subst(substitutions)->getCanonicalType();
2718+
underlyingDependentType.subst(substitutions);
27192719
auto underlyingConformance =
27202720
substitutions.lookupConformance(underlyingDependentType, P);
27212721

27222722
if (underlyingType->hasTypeParameter()) {
2723-
underlyingConformance = underlyingConformance.subst(
2724-
underlyingType, QueryInterfaceTypeSubstitutions(genericEnv),
2725-
LookUpConformanceInModule());
2726-
2727-
underlyingType = genericEnv->mapTypeIntoContext(underlyingType)
2728-
->getCanonicalType();
2723+
std::tie(underlyingType, underlyingConformance)
2724+
= GenericEnvironment::mapConformanceRefIntoContext(
2725+
genericEnv, underlyingType, underlyingConformance);
27292726
}
27302727

2731-
return emitWitnessTableRef(IGF, underlyingType, underlyingConformance);
2728+
return emitWitnessTableRef(IGF, underlyingType->getCanonicalType(),
2729+
underlyingConformance);
27322730
}
27332731
};
27342732
};

0 commit comments

Comments
 (0)