Skip to content

Commit 4549089

Browse files
committed
IRGen: Reduce type witnesses in hasDependentTypeWitness()
1 parent 59f9298 commit 4549089

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/IRGen/GenProto.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1006,6 +1006,8 @@ static bool hasDependentTypeWitness(
10061006
if (!DC->isGenericContext())
10071007
return false;
10081008

1009+
auto genericSig = conformance->getGenericSignature();
1010+
10091011
// Check whether any of the associated types are dependent.
10101012
if (conformance->forEachTypeWitness(
10111013
[&](AssociatedTypeDecl *requirement, Type type,
@@ -1015,7 +1017,7 @@ static bool hasDependentTypeWitness(
10151017
return false;
10161018

10171019
// RESILIENCE: this could be an opaque conformance
1018-
return type->getCanonicalType()->hasTypeParameter();
1020+
return type->getReducedType(genericSig)->hasTypeParameter();
10191021
},
10201022
/*useResolver=*/true)) {
10211023
return true;

0 commit comments

Comments
 (0)