Is this supported? I can't test it with the latest Xcode snapshot, it crashes on me.
@propertyWrapper
struct Wrapper<Value> {
var wrappedValue: Value
}
extension Wrapper where Value == Int {
var projectedValue: String {
return "\(wrappedValue)"
}
}
struct S {
@Wrapper var a = "swift"
@Wrapper var b = 42
func foo() {
// print(self.$a)
print(self.$b)
}
}
let s = S()
s.foo()
cc @Douglas_Gregor
If this is not supported, but should, let me know I'll file a ticket.