[Pitch #3] SE-0293: Extend Property Wrappers to Function and Closure Parameters

If the associated value type is the backing wrapper type, it's already exposed. I only changed it from Filip's take because this is what was suggested in the decision notes from the first review:

  1. The functionality that allows "unwrapping" property wrappers in the pattern of a closure argument (e.g. { (@Binding item) in ) could alternatively be imagined as an orthogonal feature that applies to all patterns. If it were, such an unwrapping could work consistently in other places where patterns exist, for example for @Binding item in items , in switch case patterns, if case , etc. It would be interesting to explore such a direction.

The suggestion was for pattern matching to "unwrap", not create a new property wrapper.

Honestly, I was hesitant to include an example at all, because this direction obviously involves design work and the example raises a lot of questions. Remember that this is just a future direction and the feature is orthogonal to this proposal.

1 Like