@@ -25,6 +25,65 @@ CHANGELOG
2525Swift 5.1
2626---------
2727
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+
2887* Key path expressions can now include references to tuple elements.
2988
3089* Single-parameter functions accepting values of type ` Any ` are no
@@ -7452,12 +7511,16 @@ Swift 1.0
74527511[SR- 1446 ]: < https: // bugs.swift.org/browse/SR-1446>
74537512[SR- 1529 ]: < https: // bugs.swift.org/browse/SR-1529>
74547513[SR- 2131 ]: < https: // bugs.swift.org/browse/SR-2131>
7514+ [SR- 2176 ]: < https: // bugs.swift.org/browse/SR-2176>
74557515[SR- 2388 ]: < https: // bugs.swift.org/browse/SR-2388>
74567516[SR- 2394 ]: < https: // bugs.swift.org/browse/SR-2394>
74577517[SR- 2608 ]: < https: // bugs.swift.org/browse/SR-2608>
7518+ [SR- 2688 ]: < https: // bugs.swift.org/browse/SR-2688>
74587519[SR- 4248 ]: < https: // bugs.swift.org/browse/SR-4248>
74597520[SR- 5581 ]: < https: // bugs.swift.org/browse/SR-5581>
74607521[SR- 5719 ]: < https: // bugs.swift.org/browse/SR-5719>
74617522[SR- 7139 ]: < https: // bugs.swift.org/browse/SR-7139>
74627523[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>
74637526[SR- 8109 ]: < https: // bugs.swift.org/browse/SR-8109>
0 commit comments