The third review of SE-0293 has concluded. Feedback in the third round of review was quite positive, a result of the great iteration from the previous rounds of proposal. As such, the core team has accepted the proposal as written.
Thank you to the proposal authors and to the community for the discussion and iteration, and for helping make Swift a better language!
Does the acceptance of proposal imply that we will get the ability to apply property wrappers onto constants?
@Wrapper
let constant = 42
The proposal enforces a similar behavior with function parameters where the backing storage is a constant and the synthesized computed variables are read only.
No; the only additional capabilities of property wrappers gained with the acceptance of this proposal are the capabilities specified in the proposal.
I do think it would be useful to have a way to declare that the backing storage is immutable for a wrapped property or local variable, but that will need to be a separate proposal.
Hello,
I saw here that this feature is included in Swift 5.5.
Is it mentioned somewhere in the official documentation?
I couldn't find anything but maybe it has been renamed to something else now that wrappers are no longer limited to properties.
Ok thank you for the confirmation.
The example given in the "What's new in Swift" WWDC session was a bit confusing.
But reading the "Detailed design" section in the proposal was very helpful.
Maybe the official language guide could link to the proposal? Or maybe it will get updated later.
Thanks.