From 1991826044358ebc2bccf82dec53c35e8653132c Mon Sep 17 00:00:00 2001 From: Doug Gregor Date: Tue, 10 Nov 2020 11:32:22 -0800 Subject: [PATCH] [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. --- lib/Sema/TypeCheckProtocol.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Sema/TypeCheckProtocol.cpp b/lib/Sema/TypeCheckProtocol.cpp index 038a088f906ac..cb3b06d268077 100644 --- a/lib/Sema/TypeCheckProtocol.cpp +++ b/lib/Sema/TypeCheckProtocol.cpp @@ -1566,7 +1566,7 @@ isUnsatisfiedReq(ConformanceChecker &checker, if (otherReq == req) continue; - if (conformance->hasWitness(otherReq)) + if (conformance->getWitness(otherReq)) return false; } }