Hi everyone,
I just updated one of my projects to Swift 5 and have a pretty weird occurrence. I'm using a GKStateMachine
to handle states for a game. When entering a state I also set the value of an enum to the related case for cleaner communication to the outside (delegation for UI etc…). Now after the update to Swift 5 this isn't properly working anymore. For example when setting the StateMachines state to GamePausedState (can be seen in the example) it should also set the current state of the enum to .paused but instead it enters .preparing
The enum contains multiple cases with associated values. Removing those fixes the issue.
I think the root of the problem might be the multiple/nested associated values.
Same outcome in both Xcode 10.2 and Xcode 10.2.1
Example Playground that reproduces the issue: https://www.sendspace.com/file/qudvzt
Hope this isn't a duplicate.
Thanks and best regards
Arthur