Skip to content

Commit 4fe523b

Browse files
authored
Merge pull request swiftlang#40826 from nate-chandler/wrangle/20220112/1
2 parents 3de0bbb + 9b021c9 commit 4fe523b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

validation-test/SILOptimizer/lexical-lifetimes.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,9 @@ class FooerAsync {
181181
return do_foo_async {
182182
// At this point, strongSelf is keeping the object alive.
183183
weakSelf?.foo1()
184-
// By this point, strongSelf has been nil'd, dropping the object's retain
185-
// count to 0, deallocating the object, so weakSelf is nil.
184+
// By this point, strongSelf has been nil'd. However, self in the
185+
// enclosing foo() may still be keeping the object alive, depending on how
186+
// the closure was scheduled.
186187
weakSelf?.foo2()
187188
}
188189
}
@@ -192,7 +193,6 @@ class FooerAsync {
192193
strongSelf = nil
193194
}
194195
func foo2() {
195-
// CHECK-NOT: FooerAsync foo2
196196
print(type(of: self), #function)
197197
}
198198
}

0 commit comments

Comments
 (0)