@@ -25,6 +25,65 @@ CHANGELOG
25
25
Swift 5.1
26
26
---------
27
27
28
+ * [ SR-7799] [ ] :
29
+
30
+ Enum cases can now be matched against an optional enum without
31
+ requiring a '?' at the end of the pattern.
32
+
33
+ ``` swift
34
+ enum Foo { case zero , one }
35
+
36
+ let foo: Foo? = .zero
37
+
38
+ switch foo {
39
+ case .zero : break
40
+ case .one : break
41
+ case .none : break
42
+ }
43
+ ```
44
+
45
+ * ` weak ` and ` unowned ` variables can now be used inside types that
46
+ declare ` Equatable ` or ` Hashable ` conformance.
47
+
48
+ * [ SR-2688] [ ] :
49
+
50
+ An ` @autoclosure ` closure can now be a typealias.
51
+
52
+ ``` swift
53
+ class Foo {
54
+ typealias FooClosure = () -> String
55
+ func fooFunction (closure : @autoclosure FooClosure) {}
56
+ }
57
+ ```
58
+
59
+ * [ SR-7601] [ ] :
60
+
61
+ Functions marked with ` @objc ` can now return ` Self `
62
+
63
+ ``` swift
64
+ @objc func returnDynamicSelf () -> Self { return self }
65
+ ```
66
+
67
+ * [ SR-2176] [ ] :
68
+
69
+ Assigning '.none' to an optional enum which also has a 'none' case
70
+ or comparing such an enum with '.none' will now warn. Such expressions
71
+ create an ambiguity because the compiler chooses Optional.none
72
+ over Foo.none.
73
+
74
+ ``` swift
75
+ enum Foo { case none }
76
+
77
+ // Assigned Optional.none instead of Foo.none
78
+ let foo: Foo? = .none
79
+ // Comparing with Optional.none instead of Foo.none
80
+ let isEqual = foo == .none
81
+ ```
82
+
83
+ The compiler will provide a warning along with a fix-it to
84
+ replace '.none' with 'Optional.none' or 'Foo.none' to resolve
85
+ the ambiguity.
86
+
28
87
* Key path expressions can now include references to tuple elements.
29
88
30
89
* Single-parameter functions accepting values of type ` Any ` are no
@@ -7452,12 +7511,16 @@ Swift 1.0
7452
7511
[SR- 1446 ]: < https: // bugs.swift.org/browse/SR-1446>
7453
7512
[SR- 1529 ]: < https: // bugs.swift.org/browse/SR-1529>
7454
7513
[SR- 2131 ]: < https: // bugs.swift.org/browse/SR-2131>
7514
+ [SR- 2176 ]: < https: // bugs.swift.org/browse/SR-2176>
7455
7515
[SR- 2388 ]: < https: // bugs.swift.org/browse/SR-2388>
7456
7516
[SR- 2394 ]: < https: // bugs.swift.org/browse/SR-2394>
7457
7517
[SR- 2608 ]: < https: // bugs.swift.org/browse/SR-2608>
7518
+ [SR- 2688 ]: < https: // bugs.swift.org/browse/SR-2688>
7458
7519
[SR- 4248 ]: < https: // bugs.swift.org/browse/SR-4248>
7459
7520
[SR- 5581 ]: < https: // bugs.swift.org/browse/SR-5581>
7460
7521
[SR- 5719 ]: < https: // bugs.swift.org/browse/SR-5719>
7461
7522
[SR- 7139 ]: < https: // bugs.swift.org/browse/SR-7139>
7462
7523
[SR- 7251 ]: < https: // bugs.swift.org/browse/SR-7251>
7524
+ [SR- 7601 ]: < https: // bugs.swift.org/browse/SR-7601>
7525
+ [SR- 7799 ]: < https: // bugs.swift.org/browse/SR-7799>
7463
7526
[SR- 8109 ]: < https: // bugs.swift.org/browse/SR-8109>
0 commit comments