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
+17-1Lines changed: 17 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,22 @@ _**Note:** This is in reverse chronological order, so newer entries are added to
5
5
6
6
## Swift 5.7
7
7
8
+
* References to `optional` methods on a protocol metatype, as well as references to dynamically looked up methods on the `AnyObject` metatype are now supported. These references always have the type of a function that accepts a single argument and returns an optional value of function type:
9
+
10
+
```swift
11
+
classObject {
12
+
@objcfuncgetTag() ->Int
13
+
}
14
+
15
+
@objcprotocolP {
16
+
@objcoptionalfuncdidUpdateObject(withTagtag: Int)
17
+
}
18
+
19
+
let getTag: (AnyObject) -> (() ->Int)?=AnyObject.getTag
20
+
21
+
let didUpdateObject: (any P) -> ((Int) ->Void)?= P.didUpdateObject
22
+
```
23
+
8
24
*[SE-0352][]:
9
25
10
26
It's now possible to call a generic function with a value of protocol type
@@ -32,7 +48,7 @@ _**Note:** This is in reverse chronological order, so newer entries are added to
32
48
It's now possible to use a default value expression with a generic parameter type
33
49
to default the argument and its type:
34
50
35
-
```
51
+
```swift
36
52
funccompute<C: Collection>(_values: C = [0, 1, 2]) {
0 commit comments