Skip to content

Commit d3d9428

Browse files
committed
[AST] Make NormalProtocolConformance::forEachTypeWitness more robust.
If we cannot resolve a type witness, don't try.
1 parent 56040ef commit d3d9428

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

include/swift/AST/ProtocolConformance.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,10 @@ class alignas(1 << DeclAlignInBits) ProtocolConformance {
181181
if (!assocTypeReq || req->isInvalid())
182182
continue;
183183

184+
// If we don't have and cannot resolve witnesses, skip it.
185+
if (!resolver && !hasTypeWitness(assocTypeReq))
186+
continue;
187+
184188
const auto &TWInfo = getTypeWitnessSubstAndDecl(assocTypeReq, resolver);
185189
if (f(assocTypeReq, TWInfo.first, TWInfo.second))
186190
return true;

0 commit comments

Comments
 (0)