You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+30Lines changed: 30 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,6 +29,36 @@ CHANGELOG
29
29
Swift 5.5
30
30
---------
31
31
32
+
*[SE-0293][]:
33
+
34
+
Property wrappers can now be applied to function and closure parameters:
35
+
36
+
```swift
37
+
@propertyWrapper
38
+
structWrapper<Value> {
39
+
var wrappedValue: Value
40
+
41
+
var projectedValue: Self { returnself }
42
+
43
+
init(wrappedValue: Value) { ... }
44
+
45
+
init(projectedValue: Self) { ... }
46
+
}
47
+
48
+
functest(@Wrappervalue: Int) {
49
+
print(value)
50
+
print($value)
51
+
print(_value)
52
+
}
53
+
54
+
test(value: 10)
55
+
56
+
let projection =Wrapper(wrappedValue: 10)
57
+
test($value: projection)
58
+
```
59
+
60
+
The call-site can pass a wrapped value or a projected value, and the property wrapper will be initialized using `init(wrappedValue:)` or `init(projectedValue:)`, respectively.
61
+
32
62
*[SE-0299][]:
33
63
34
64
It is now possible to use leading-dot syntax in generic contexts to access static members of protocol extensions where `Self` is constrained to a fully concrete type:
0 commit comments