swift
d89f6cdd - [TypeChecker] PropertyWrappers: Re-parent any captures from wrapped to backing property

Commit
3 years ago
[TypeChecker] PropertyWrappers: Re-parent any captures from wrapped to backing property In the situations where initializer of property wrapper attribute has any kind of captures i.e. `{ [x = ...] ... }` they should be re-parented to the backing property because that's actually where the expression gets used - initializer of the backing property, e.g: ```swift struct Test { @Wrapper([1, 2, 3].map { [x = 42] ... }) var x: Int } ``` is transformed into: ```swift struct Test { var x: Int { get { ... } set { ... } } var _x: Wrapper<Int> = Wrapper(wrappedValue: [1, 2, 3].map { [x = 42] ... }) } ``` Resolves: https://github.com/apple/swift/issues/61570 Resolves: rdar://problem/101813792
Author
Committer
Parents
Loading