Pitch #2: Protocol-based Actor Isolation

I think this proposal will have some impact on the "stored properties in extensions" idea that had been discussed many times in the forums. The latest (short) discussion was from 4 months ago:

For example, if String conforms to ActorSendable, then it would be an error to extend it with a stored reference-type property:

extension String {
    let newStoredProperty: NSMutableString = "a mutable string"
}

"Stored properties in extensions" is not a Swift feature, and definitely outside of the scope of this proposal, but I think it might be beneficial to discuss about this proposal's impact on it.

1 Like