Commit Graph

8 Commits

Author SHA1 Message Date
Doug Gregor
f51119ad6b [Property wrappers] Sync up implicit "nil" initialization defaulting.
Perform implicit "nil" initialization for a wrapped property only when
the memberwise initializer's parameter is of the wrapped type.
2019-12-05 22:04:18 -08:00
Doug Gregor
9a444242fb [SE-0258] Fixups for various renames of property wrappers. 2019-07-10 15:28:24 -07:00
Doug Gregor
446d0b3953 [SE-0258] Rename backing storage property to _foo.
In anticipation of upcoming changes to the property wrapper proposal,
rename the backing storage for a wrapped property to "foo", unconditionally.
2019-06-26 07:39:01 -07:00
Doug Gregor
22e40fedf5 [SE-0258] Enable default argument for wrapped property going through init().
My recent refactoring of default arguments for the memberwise initializer
accidentally dropped support for getting a default argument when the
attached property wrapper has an init(). Reinstate that support,
fixing rdar://problem/52116923.
2019-06-25 10:03:15 -07:00
Doug Gregor
2e8d9a4331 [SE-0258] Adopt @propertyWrapper everywhere. 2019-06-12 13:09:40 -07:00
Doug Gregor
0a1b18fe2f [SE-0258] Clean up memberwise initializer / default-initialization interaction
When the backing storage of a wrapped property is default-initialized via the
property wrapper type's init(), don't count that as a direct initialization
of the backing storage for the purposes of constructing the memberwise
initializer. Instead, treat this case the same as if there were no initializer,
keying the form of the memberwise initializer off the presence of
init(initialValue:).
2019-06-12 11:26:40 -07:00
Doug Gregor
1a555dfeda [SE-0258] Fix memberwise initializer involving wrapped properties.
The determination of which type to use within the implicit memberwise
initializer for a wrapper property (between the original property type
and the wrapper type) could be affected by the synthesis of the call
to the default initializer. Rewrite the logic here to depend on
aspects of the AST that don't change with further type checking.
2019-06-06 11:01:45 -07:00
Doug Gregor
c02ecf9859 [SE-0258] Rename to Property Wrappers 2019-05-29 22:17:50 -07:00