Skip to content

Commit 1991826

Browse files
committed
[Protocol checker] Eliminate ordering dependency with "unsatisfied" check.
When checking whether an @objc protocol requirement is considered satisfied by another requirement with the same selector, make sure to use "getWitness" (rather than "hasWitness") to avoid order dependencies in the computation. These are fantastically hard to reproduce in small test cases.
1 parent e201c73 commit 1991826

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/Sema/TypeCheckProtocol.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1566,7 +1566,7 @@ isUnsatisfiedReq(ConformanceChecker &checker,
15661566
if (otherReq == req)
15671567
continue;
15681568

1569-
if (conformance->hasWitness(otherReq))
1569+
if (conformance->getWitness(otherReq))
15701570
return false;
15711571
}
15721572
}

0 commit comments

Comments
 (0)