-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove some unnecessary @unchecked Sendables. #233
Conversation
@@ -677,13 +676,12 @@ where Base.Value: Hashable { | |||
} | |||
} | |||
|
|||
private final class _UIBindingEnumToOptionalCase<Base: _UIBinding, Case>: _UIBinding, @unchecked | |||
Sendable | |||
private final class _UIBindingEnumToOptionalCase<Base: _UIBinding, Case>: _UIBinding |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This lose the Sendable
? Or is it implicit and can we remove the explicit one above?
private final class _UIBindingEnumToOptionalCase<Base: _UIBinding, Case>: _UIBinding | |
private final class _UIBindingEnumToOptionalCase<Base: _UIBinding, Case>: _UIBinding, Sendable |
Or should it be conditional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_UIBinding
is : Sendable
so we already get it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Just a few considerations.
public typealias _KeyPath<Root, Value> = any KeyPath<Root, Value> & Sendable | ||
public typealias _WritableKeyPath<Root, Value> = any WritableKeyPath<Root, Value> & Sendable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wonder if we make this explicit for readability:
public typealias _KeyPath<Root, Value> = any KeyPath<Root, Value> & Sendable | |
public typealias _WritableKeyPath<Root, Value> = any WritableKeyPath<Root, Value> & Sendable | |
public typealias _SendableKeyPath<Root, Value> = any KeyPath<Root, Value> & Sendable | |
public typealias _SendableWritableKeyPath<Root, Value> = any WritableKeyPath<Root, Value> & Sendable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep good idea, done! I can do that over in TCA too.
We have a few
@unchecked Sendable
s that aren't really necessary, so cleaning them up.