Skip to content

Commit ccdcfa6

Browse files
committed
Update CHANGELOG.md for recent changes, in particular source breaks
1 parent 77dc2e8 commit ccdcfa6

File tree

1 file changed

+109
-8
lines changed

1 file changed

+109
-8
lines changed

CHANGELOG.md

+109-8
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,49 @@ CHANGELOG
2323

2424
Swift 5.0
2525
---------
26+
27+
* Swift 3 mode has been removed. Supported values for the `-swift-version`
28+
flag are `4`, `4.2`, and `5`.
29+
30+
* [SE-0228][]:
31+
32+
String interpolation has been overhauled to improve its performance,
33+
clarity, and efficiency.
34+
35+
Note that the old `_ExpressibleByStringInterpolation` protocol has been
36+
removed; any code making use of this protocol will need to be updated
37+
for the new design. An `#if compiler` block can be used to conditionalize
38+
code between 4.2 and 5.0, for example:
39+
40+
```swift
41+
#if compiler(<5.0)
42+
extension MyType : _ExpressibleByStringInterpolation { ... }
43+
#else
44+
extension MyType : ExpressibleByStringInterpolation { ... }
45+
#endif
46+
```
47+
48+
* [SE-0213][]:
49+
50+
If `T` conforms to one of the `ExpressibleBy*` protocols and `literal` is a
51+
literal expression, then `T(literal)` will construct a literal of type `T`
52+
using the corresponding protocol, rather than calling a constructor member
53+
of `T` with a value of the protocol's default literal type.
54+
55+
For example, expressions like `UInt64(0xffff_ffff_ffff_ffff)` are now valid,
56+
where previously they would overflow the default integer literal type of `Int`.
57+
58+
* [SE-0230][]:
59+
60+
In Swift 5 mode, `try?` with an expression of Optional type will flatten the
61+
resulting Optional, instead of returning an Optional of an Optional.
62+
2663
* [SR-5719][]:
2764

28-
Starting from `-swift-version 5`, implicit `@autoclosure` function type
29-
forwarding has been disabled, and new a diagnostic has been added suggesting
30-
to add `()` to call the function value in such case. The call itself would be
31-
wrapped in an implicit closure and passed to the corresponding parameter.
65+
In Swift 5 mode, `@autoclosure` parameters can no longer be forwarded to
66+
`@autoclosure` arguments in another function call. Instead, you must explicitly
67+
call the function value with `()`; the call itself is wrapped inside an
68+
implicit closure, guaranteeing the same behavior as in Swift 4 mode.
3269

3370
Example:
3471

@@ -40,6 +77,56 @@ Swift 5.0
4077
}
4178
```
4279

80+
* [SR-8109][]:
81+
82+
Single-element labeled tuple expressions, for example `(label: 123)`, were
83+
allowed in some contexts but often resulted in surprising, inconsistent
84+
behavior that varied across compiler releases. They are now completely
85+
disallowed.
86+
87+
Note that single-element labeled _types_, for example `var x: (label: Int)`,
88+
have already been prohibited since Swift 3.
89+
90+
* [SR-695][]:
91+
92+
In Swift 5 mode, a class method returning `Self` can no longer be overridden
93+
with a method returning a non-final concrete class type. Such code is not
94+
type safe and will need to be updated.
95+
96+
For example,
97+
98+
```swift
99+
class Base {
100+
class func factory() -> Self { ... }
101+
}
102+
103+
class Derived : Base {
104+
class override func factory() -> Derived { ... }
105+
}
106+
```
107+
108+
* In Swift 5 mode, the type of `self` in a convenience initializer of a non-final
109+
class is now the dynamic `Self` type, and not the concrete class type.
110+
111+
* [SR-5581][]:
112+
113+
Protocols can now constrain their conforming types to those that subclasses a
114+
given class. Two equivalent forms are supported:
115+
116+
```swift
117+
protocol MyView : UIView { ... }
118+
protocol MyView where Self : UIView { ... }
119+
```
120+
121+
Note that Swift 4.2 accepted the second form, but it was not fully implemented
122+
and could sometimes crash at compile time or run time.
123+
124+
* [SR-631][]:
125+
126+
Extension binding now supports extensions of nested types which themselves are
127+
defined inside extensions. Previously this could fail with some declaration orders,
128+
producing spurious "undeclared type" errors.
129+
43130
* [SR-7139][]:
44131

45132
Exclusive memory access is now enforced at runtime by default in
@@ -129,16 +216,24 @@ Swift 5.0
129216

130217
* [SE-0214][]:
131218

132-
Renamed the `DictionaryLiteral` type to `KeyValuePairs`.
219+
The `DictionaryLiteral` type has been renamed to `KeyValuePairs`.
133220
A typealias preserves the old name for compatibility.
134221

135222
* [SR-2608][]
136223

137224
Default arguments are now printed in SourceKit-generated interfaces for Swift
138225
modules, instead of just using a placeholder `default`.
139226

140-
* Notable bug fix: unowned and unowned(unsafe) variables now support optional
141-
types.
227+
* `unowned` and `unowned(unsafe)` variables now support Optional types.
228+
229+
* Designated initializers with variadic parameters are now correctly inherited
230+
in subclasses.
231+
232+
* Extensions of concrete subclasses of generic classes can now contain
233+
`@objc` members.
234+
235+
* Complex recursive type definitions involving classes and generics that would
236+
previously cause deadlocks at run time are now fully supported.
142237

143238
* [SR-419][]
144239

@@ -7309,9 +7404,13 @@ Swift 1.0
73097404
[SE-0225]: <https://github.com/apple/swift-evolution/blob/master/proposals/0225-binaryinteger-iseven-isodd-ismultiple.md>
73107405
[SE-0226]: <https://github.com/apple/swift-evolution/blob/master/proposals/0226-package-manager-target-based-dep-resolution.md>
73117406
[SE-0227]: <https://github.com/apple/swift-evolution/blob/master/proposals/0227-identity-keypath.md>
7407+
[SE-0228]: <https://github.com/apple/swift-evolution/blob/master/proposals/0228-fix-expressiblebystringinterpolation.md>
7408+
[SE-0230]: <https://github.com/apple/swift-evolution/blob/master/proposals/0230-flatten-optional-try.md>
73127409

73137410
[SR-106]: <https://bugs.swift.org/browse/SR-106>
73147411
[SR-419]: <https://bugs.swift.org/browse/SR-419>
7412+
[SR-631]: <https://bugs.swift.org/browse/SR-631>
7413+
[SR-695]: <https://bugs.swift.org/browse/SR-695>
73157414
[SR-1009]: <https://bugs.swift.org/browse/SR-1009>
73167415
[SR-1446]: <https://bugs.swift.org/browse/SR-1446>
73177416
[SR-1529]: <https://bugs.swift.org/browse/SR-1529>
@@ -7320,6 +7419,8 @@ Swift 1.0
73207419
[SR-2394]: <https://bugs.swift.org/browse/SR-2394>
73217420
[SR-2608]: <https://bugs.swift.org/browse/SR-2608>
73227421
[SR-4248]: <https://bugs.swift.org/browse/SR-4248>
7422+
[SR-5581]: <https://bugs.swift.org/browse/SR-5581>
7423+
[SR-5719]: <https://bugs.swift.org/browse/SR-5719>
73237424
[SR-7139]: <https://bugs.swift.org/browse/SR-7139>
73247425
[SR-7251]: <https://bugs.swift.org/browse/SR-7251>
7325-
[SR-5719]: <https://bugs.swift.org/browse/SR-5719>
7426+
[SR-8109]: <https://bugs.swift.org/browse/SR-8109>

0 commit comments

Comments
 (0)