You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I cannot see how the assignment here could actually result in a race or be meaningfully-different than using a default value expression.
classNonSendable{}@MainActorstructAssignsInInit{varparam:Intvarvalue:NonSendablenonisolatedinit(param:Int, value:NonSendable){self.param = param
self.value = value // error: main actor-isolated property 'value' can not be mutated from a nonisolated context
}}@MainActorstructAssignsViaDefaultExpression{varparam:Intvarvalue=NonSendable()nonisolatedinit(param:Int, value:NonSendable){self.param = param
}}
Proposed solution
I think this code should compile error-free.
Alternatives considered
No response
Additional information
No response
The text was updated successfully, but these errors were encountered:
Motivation
I cannot see how the assignment here could actually result in a race or be meaningfully-different than using a default value expression.
Proposed solution
I think this code should compile error-free.
Alternatives considered
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: