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
You're probably being fooled by some immortal string optimization such as tagged pointers or string ROM. Try string values that are longer and less likely to be shared.
I get the following behavior from Joe's arrangement on macOS:
Yeah, immortal strings sound like a good theory. Even this gives the expected result!
letx = "foo"varfoo: NSObject? = xasNSStringweakvarfooWeak = fooprint("---------> before foo set to nil: \(foo) / \(fooWeak)")
foo = nilprint("---------> after foo set to nil: \(foo) / \(fooWeak)")
Environment
Xcode 9 beta 3
Swift 4
iOS Simulator
Additional Detail from JIRA
md5: 9046237588d6193d375e2a5ac23c2abd
Issue Description:
The following code in a playground:
…produces this output (as expected) on all platforms in XC8, and on macOS in XC9:
…but using the iOS Simulator in XC9, the weak ref doesn’t get nilled out:
The text was updated successfully, but these errors were encountered: