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
When creating a Swift Singleton object as follows:
staticletsharedHandler = SomeHandler()
If the singleton initializes top-level variables at the time of initialization, and if those variables' initializers reference the singleton object, the execution thread enters an infinite loop.
The text was updated successfully, but these errors were encountered:
I don't think there's a fix for this, but maybe we could at least detect the infinite loop in debug builds or something, so we get a more reliable error?
Agreed – seems like something that could potentially be caught / warned against at build time. Any suggestions on where I might go looking around to make a contribution for this?
Environment
Swift 4.2
Xcode 10.1 (10B61)
macOS 10.14.2 (18C54)
Additional Detail from JIRA
md5: 265449bf1b4b45378b6f0bec0aede923
Issue Description:
When creating a Swift Singleton object as follows:
If the singleton initializes top-level variables at the time of initialization, and if those variables' initializers reference the singleton object, the execution thread enters an infinite loop.
The text was updated successfully, but these errors were encountered: