[Pitch #3] Property wrappers (formerly known as Property Delegates)

I see you concerns and it makes sense that @dynamicMemberLookup is likely to collide with some of the members from the annotated type. However I don't like the name changes you suggested. Both propertyWrapperValue and propertyWrapper are either too verbose or/and ambiguous in their meanings. To me as a non native English speaker both read as they providing the same thing.

Instead I propose only to change value into wrappedValue.

This plays nicely with wrapperValue. One of them refers to the value the property wrapper wraps and the other what the property wrapper itself will become if you try to access it.

Furthermore I understand that the difference between them is just a single character, but I also think that this does not really matter as wrapperValue cannot be accessed directly anyway. So both wrappedValue and wrapperValue won't possibly collide with anything unlike value did in the above example.

@Douglas_Gregor what do you think about wrappedValue?


@AliSoftware meanwhile you can workaround your issue by writing cell.$item[\.value].

12 Likes