[proposal] Actor Initializers and Deinitializers

For the updated proposal under review, it's still considered a bug to get a warning when assigning to a non-Sendable property in the initializer like I mentioned.

Right, so the proposed solution that provides safety is to prevent preexisting non-sendable values from entering the non-delegating initializer of an actor. Until we have something like move-only types, the compiler has no way to guarantee that a reference is unique. Placing the restriction on the arguments to an initializer effectively limits the reference-sharing danger to globals, but we haven't addressed globals yet within the model. Plus, it matches up with how actor methods work with Sendable.

By the way, I specifically address this situation in the updated proposal. Feel free to leave a review and/or your thoughts about this in the review thread. :slight_smile:

1 Like