Should BindingAction
and BindableState
conforming to Sendable?
#1672
-
I got bunch of warnings when using struct State: Equtable {
// WARNING: Stored property '*' of 'Sendable'-conforming struct 'State' has non-sendable type 'BindableState<*>'
@BindableState var someFeature: SomeFeature.State
...
}
enum Action: BindableAction, Equatable {
// WARNING: Associated value 'binding' of 'Sendable'-conforming enum 'Action' has non-sendable type 'BindingAction<*>'
case binding(BindingAction<State>
...
} since the extension BindableState: Sendable where Value: Sendable {}
extension BindingAction: Sendable where Root: Sendable {} By the way, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
Hi @ikarishinjigao, we might be able to make those types Can you share some code of how these warnings come up for you?> |
Beta Was this translation helpful? Give feedback.
Hi @ikarishinjigao, we might be able to make those types
Sendable
, but I'm curious how exactly you are getting the warnings. It should only happen if you are passing aBindingAction
/BindableAction
/TextState
/AlertState
/etc across a concurrent boundary, which I feel should be very rare. I can't think of a situation where it happens.Can you share some code of how these warnings come up for you?>