You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (auto declRef = dyn_cast<DeclRefExpr>(selfRef)) {
1646
1646
if (auto decl = declRef->getDecl()) {
1647
1647
if (auto varDecl = dyn_cast<VarDecl>(decl)) {
1648
-
// If the self decl was defined in an `if` or `guard` statement, we know this is an inner closure of some outer closure's `weak self` capture. Since this wasn't allowed in Swift 5.5, we should just always emit an error.
1648
+
// If the self decl was defined in an conditional binding in an `if`/`guard`/`while`,
1649
+
// then we know this is an inner closure of some outer closure's `weak self` capture.
1650
+
// Since this wasn't allowed in Swift 5.5, we should just always emit an error.
1649
1651
if (auto parentStmt = varDecl->getParentPatternStmt()) {
1650
-
if (isa<GuardStmt>(parentStmt) || isa<IfStmt>(parentStmt)) {
0 commit comments