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
I have run into an issue where the compiler is emitting the wrong value for an enum case at a call-site which in turn causes unexpected behaviour downstream when the value is pattern matched.
I have been able to reproduce with this trivial example:
importSwiftUIenumFoo {
caseonecasetwo(ScenePhase)
casethreecasefour(Bool)
casefivecasesixcaseseven
}
print(Foo.seven) // prints "one"
I have also observed that the issue goes away when:
there are six cases only and not seven
the ScenePhase payload is replaced with a different type such as String
the Bool payload is removed so there is only a single associated type of ScenePhase
Others have observed this may be happening when using associated values that are non-frozen resilient enum types, see discussion here.
The text was updated successfully, but these errors were encountered:
Environment
Reproduced in Xcode 13.2.1 and Xcode 13.1
Additional Detail from JIRA
md5: 90042d7a0dc9ccb216eb19873e3d6a1b
Issue Description:
I have run into an issue where the compiler is emitting the wrong value for an
enum
case at a call-site which in turn causes unexpected behaviour downstream when the value is pattern matched.I have been able to reproduce with this trivial example:
I have also observed that the issue goes away when:
there are six cases only and not seven
the
ScenePhase
payload is replaced with a different type such asString
the
Bool
payload is removed so there is only a single associated type ofScenePhase
Others have observed this may be happening when using associated values that are non-frozen resilient
enum
types, see discussion here.The text was updated successfully, but these errors were encountered: