Replies: 1 comment 1 reply
-
|
@seanmrich This is feeling like a bug (either in Swift or in our library if this is expected behavior in the language). I won't have time to look at it until tomorrow, but would a |
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.
-
I think I’ve isolated what looks like a TCA issue involving
@Sharedstate andBindableAction.Reading a
@Sharedproperty is fine in all of these cases:StateExample
store.state.valueExample
@ObservablemodelExample
Example
But reading a shared property from a store whose
Actionconforms toBindableActionwithin aViewemits a@Sharedsetter deprecation/unavailability warning.Example
My guess is that the culprit is the bindable store dynamic-member overload in Binding+Observation.swift:
The bindable case resolves through a
WritableKeyPathand forming that key path forces Swift to consider@Shared's setter even though this is just a read op. Reading through thestateproperty likelet _ = store.state.valueresolves the warning, but I'm not sure if I'm just papering over a bigger issue. Is this just something that will have to remain until TCA 2?Beta Was this translation helpful? Give feedback.
All reactions