Commit Graph

3 Commits

Author SHA1 Message Date
Daniel Duan
62e0da9913 [Property wrappers] Modernize self enclosing test (#30103)
The init parameter name changed to `wrappedValue` as of Swift 5.2.
2020-02-27 16:05:36 -08:00
Doug Gregor
bc2e605b31 [Property wrappers] Improve enclosing-self subscript handling.
Extend handling of enclosing-self subscripts by differentiating
between the original wrapped property (which now goes through
`subscript(_enclosingInstance:wrapped:storage:)`) and the projected
property (which goes through
`subscript(_enclosingInstance:projected:storage:)`). The new middle
argument provides a key path to the property that was accessed,
allowing one to distinguish the property being updated.
2019-06-29 23:22:01 -07:00
Doug Gregor
8c54db727b [Property wrappers] Prototype support for enclosing self-based access
Allow property wrapper types to support a second access pattern for
instance properties of classes. When supported, the property wrapper's
static subscript(_enclosingInstance:storage:) is provided with the
enclosing "self" and a reference-writable key path referring to the
backing storage property.

Implements rdar://problem/52222560.
2019-06-29 00:08:49 -07:00