Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardSwiftARC internals retain releaseSingle-choice MCQ

An `-O` build can make a `weak` capture appear non-nil at a use site where a debug build would see nil, when the strong owner is a local that is 'no longer used.' What runtime/compiler interaction explains this?

final class C { func ping() {} } func f() { let c = C() weak var w = c // ... last textual use of c is above w?.ping() }