Skip to content

Commit a89564b

Browse files
committed
[NFC] Paranoia and grammar
1 parent a5c659b commit a89564b

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

lib/Sema/CSSimplify.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5579,9 +5579,11 @@ bool ConstraintSystem::repairFailures(
55795579
}
55805580

55815581
if (auto *VD = getAsDecl<ValueDecl>(anchor)) {
5582-
// Matching a witness to a ObjC protocol requirement.
5583-
if (VD->isObjC() && VD->isProtocolRequirement() &&
5584-
path[0].is<LocatorPathElt::Witness>() &&
5582+
// Matching a witness to an ObjC protocol requirement.
5583+
if (VD->isObjC() &&
5584+
isa<ProtocolDecl>(VD->getDeclContext()) &&
5585+
VD->isProtocolRequirement() &&
5586+
path[0].is<LocatorPathElt::Witness>() &&
55855587
// Note that the condition below is very important,
55865588
// we need to wait until the very last moment to strip
55875589
// the concurrency annotations from the inner most type.
@@ -5593,10 +5595,11 @@ bool ConstraintSystem::repairFailures(
55935595
if (!(Context.isSwiftVersionAtLeast(6) ||
55945596
Context.LangOpts.StrictConcurrencyLevel ==
55955597
StrictConcurrency::Complete)) {
5596-
auto strippedLHS = lhs->stripConcurrency(/*resursive=*/true,
5598+
auto strippedLHS = lhs->stripConcurrency(/*recursive=*/true,
55975599
/*dropGlobalActor=*/true);
5598-
auto strippedRHS = rhs->stripConcurrency(/*resursive=*/true,
5600+
auto strippedRHS = rhs->stripConcurrency(/*recursive=*/true,
55995601
/*dropGlobalActor=*/true);
5602+
56005603
auto result = matchTypes(strippedLHS, strippedRHS, matchKind,
56015604
flags | TMF_ApplyingFix, locator);
56025605
if (!result.isFailure()) {

0 commit comments

Comments
 (0)