Skip to content

Commit 0f33636

Browse files
committed
Update comments
1 parent 369e20f commit 0f33636

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

lib/Sema/MiscDiagnostics.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1530,9 +1530,10 @@ static void diagnoseImplicitSelfUseInClosure(const Expr *E,
15301530
auto isExplicitWeakSelfCapture = false;
15311531
if (auto closureExpr = dyn_cast<ClosureExpr>(inClosure)) {
15321532
if (auto selfDecl = closureExpr->getCapturedSelfDecl()) {
1533-
// If `weak self` captured explicitly, then implicit self
1533+
// If `weak self` was captured explicitly, then implicit self
15341534
// is always allowed allowed once `self` is unwrapped.
1535-
// - If `self` is still an Optional, compilation would have failed already.
1535+
// - If `self` is still an Optional, compilation would have failed already,
1536+
// so we don't need to check for that here.
15361537
if (selfDecl->getType()->is<WeakStorageType>()) {
15371538
isExplicitWeakSelfCapture = true;
15381539
}

lib/Sema/PreCheckExpr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -747,7 +747,7 @@ Expr *TypeChecker::resolveDeclRefExpr(UnresolvedDeclRefExpr *UDRE,
747747
} else {
748748
// If this is an implicit self reference, the `VarDecl` will
749749
// currently have a non-optional type. But at this point,
750-
// we don't actually know if this is corret (it could be a
750+
// we don't actually know if this is correct (it could be a
751751
// weak self capture that hasn't been unwrapped yet).
752752
// - Since we don't know the correct type of self yet,
753753
// we leave this as an UnresolvedDeclRefExpr that is

0 commit comments

Comments
 (0)