@@ -3711,20 +3711,20 @@ filterProtocolRequirements(
37113711// / Sometimes a witness isn't really diagnosed as missing if we have two
37123712// / complementary Objective-C protocol requirements, only one of which must
37133713// / be witnessed.
3714- static bool shouldRecordMissingWitness (
3715- ProtocolDecl *proto,
3716- NormalProtocolConformance *conformance,
3717- ValueDecl *requirement) {
3714+ static bool
3715+ hasSatisfiedObjCSiblingRequirement ( ProtocolDecl *proto,
3716+ NormalProtocolConformance *conformance,
3717+ ValueDecl *requirement) {
37183718 assert (proto == requirement->getDeclContext ());
37193719 assert (proto == conformance->getProtocol ());
37203720
37213721 // We only care about functions.
37223722 auto fnRequirement = dyn_cast<AbstractFunctionDecl>(requirement);
37233723 if (fnRequirement == nullptr )
3724- return true ;
3724+ return false ;
37253725
37263726 if (!proto->isObjC ())
3727- return true ;
3727+ return false ;
37283728
37293729 auto map = getObjCRequirementMap (proto);
37303730
@@ -3751,10 +3751,10 @@ static bool shouldRecordMissingWitness(
37513751 // record a missing witness.
37523752 return static_cast <bool >(conformance->getWitness (candidate));
37533753 })) {
3754- return false ;
3754+ return true ;
37553755 }
37563756
3757- return true ;
3757+ return false ;
37583758}
37593759
37603760static void diagnoseProtocolStubFixit (
@@ -4645,7 +4645,7 @@ bool ConformanceChecker::allowOptionalWitness(ValueDecl *requirement) {
46454645
46464646 // A requirement with a satisfied Obj-C alternative requirement is effectively
46474647 // optional.
4648- if (! shouldRecordMissingWitness (Proto, Conformance, requirement))
4648+ if (hasSatisfiedObjCSiblingRequirement (Proto, Conformance, requirement))
46494649 return true ;
46504650
46514651 return false ;
0 commit comments