@@ -2209,21 +2209,21 @@ static void diagnoseImplicitSelfUseInClosure(const Expr *E,
2209
2209
// unless this is something like a nonescaping closure that
2210
2210
// didn't have this layer of validation in Swift 5 mode.
2211
2211
// This doesn't apply to autoclosures.
2212
- if (auto invalidParentClosure =
2213
- parentClosureDisallowingImplicitSelf (selfDecl, ty, ACE)) {
2214
- auto invalidParentClosureExcludingOutermostCapture =
2215
- parentClosureDisallowingImplicitSelf (
2216
- selfDecl, ty, ACE, /* validateOutermostCapture:*/ false );
2217
-
2218
- // In Swift 5 mode we didn't validate the outermost capture in
2219
- // nonescaping closures, so in that case we only warn.
2220
- if (!isClosureRequiringSelfQualification (ACE, Ctx) &&
2221
- (invalidParentClosureExcludingOutermostCapture !=
2222
- invalidParentClosure)) {
2223
- return true ;
2224
- }
2212
+ if (!isa<AutoClosureExpr>(ACE)) {
2213
+ if (auto invalidParentClosure =
2214
+ parentClosureDisallowingImplicitSelf (selfDecl, ty, ACE)) {
2215
+ auto invalidParentClosureExcludingOutermostCapture =
2216
+ parentClosureDisallowingImplicitSelf (
2217
+ selfDecl, ty, ACE, /* validateOutermostCapture:*/ false );
2218
+
2219
+ // In Swift 5 mode we didn't validate the outermost capture in
2220
+ // nonescaping closures, so in that case we only warn.
2221
+ if (!isClosureRequiringSelfQualification (ACE, Ctx) &&
2222
+ (invalidParentClosureExcludingOutermostCapture !=
2223
+ invalidParentClosure)) {
2224
+ return true ;
2225
+ }
2225
2226
2226
- if (!isa<AutoClosureExpr>(ACE)) {
2227
2227
return false ;
2228
2228
}
2229
2229
}
0 commit comments