Some change in CasePath behaviour noticed #666
rehsals
started this conversation in
Show and tell
Replies: 1 comment 1 reply
-
@rehsals This is indeed pointfreeco/swift-case-paths#40. Swift's optional promotion can promote embed functions to optional-returning embed functions, which breaks some of the expectations made in the new runtime code. We hope to workaround this problem when we have time, but in the meantime using an explicit One thing you can do, though, is avoid an extra .pullback(
state: (/Optional.some).appending(path: /GlobalState.Option.local),
action: .`self`,
environment: { $0 }) |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I've been using TCA version
0.19.0
and today I've updated to0.22.0
.And instantly I've got several breakpoints about nil-states when corresponding reducer gets an action.
My setup was as follows:
So
CasePath
fromGlobalState.Option?
toLocalState
worked fine on0.19.0
and not working anymore.I've changed my code to be:
and things got back to normal.
Is this is an expected behaviour and a bug being fixed? May be it could be useful for someone in similar situations
Edit: probably it's a
CasePath
version what is more relevant. My current is0.5.0
. Unfortunately I can't tell which version I was using before the updateEdit2: there is an issue in
CasePath
repo which seems related: pointfreeco/swift-case-paths#40Beta Was this translation helpful? Give feedback.
All reactions