Skip to content

Commit d0f8079

Browse files
authored
---
yaml --- r: 293631 b: refs/heads/tensorflow c: 27b12bf h: refs/heads/master i: 293629: 8192e23 293627: bcc7e18 293623: ea82275 293615: 83936a9 293599: 665ccd4 293567: 3c218b0 293503: d64cfdc 293375: 093a42c
1 parent 4a4d1e5 commit d0f8079

File tree

2,326 files changed

+389894
-298224
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,326 files changed

+389894
-298224
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,7 @@ refs/tags/swift-DEVELOPMENT-SNAPSHOT-2018-04-25-a: 22f738a831d43aff2b9c9773bcb65
816816
refs/tags/swift-DEVELOPMENT-SNAPSHOT-2018-05-08-a: 7d98cc16689baba5c8a3b90a9329bdcc1a12b4e9
817817
refs/heads/cherr42: a566ad54b073c2c56ac0a705d0a5bed9743135a5
818818
"refs/heads/codable_test_comment_fix": fc8f6824f7f347e1e8db55bff62db385c5728b5a
819-
refs/heads/tensorflow: 7344fdb0a4b6e71cefe0d4accf5ef680d0ef8123
819+
refs/heads/tensorflow: 27b12bfe898f4b96c07e4a919d20def7e91b0e8d
820820
refs/tags/swift-4.1-DEVELOPMENT-SNAPSHOT-2018-05-11-a: 8126fd7a652e2f70ad6d76505239e34fb2ef3e1a
821821
refs/tags/swift-4.1-DEVELOPMENT-SNAPSHOT-2018-05-12-a: b3fd3dd84df6717f2e2e9df58c6d7e99fed57086
822822
refs/tags/swift-4.1-DEVELOPMENT-SNAPSHOT-2018-05-13-a: 71135119579039dc321c5f65d870050fe36efda2

branches/tensorflow/CHANGELOG.md

Lines changed: 273 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ CHANGELOG
66

77
| Contents |
88
| :--------------------- |
9+
| [Swift Next](#swift-next) |
10+
| [Swift 5.1](#swift-51) |
911
| [Swift 5.0](#swift-50) |
1012
| [Swift 4.2](#swift-42) |
1113
| [Swift 4.1](#swift-41) |
@@ -21,9 +23,266 @@ CHANGELOG
2123

2224
</details>
2325

26+
Swift Next
27+
----------
28+
29+
* [SR-6118][]:
30+
31+
Subscripts can now declare default arguments:
32+
33+
```swift
34+
struct Subscriptable {
35+
subscript(x: Int, y: Int = 0) {
36+
...
37+
}
38+
}
39+
40+
let s = Subscriptable()
41+
print(s[0])
42+
```
43+
44+
**Add new entries to the top of this section, not here!**
45+
46+
Swift 5.1
47+
---------
48+
49+
* [SE-0244][]:
50+
51+
Functions can now hide their concrete return type by declaring what protocols
52+
it conforms to instead of specifying the exact return type:
53+
54+
```
55+
func makeMeACollection() -> some Collection {
56+
return [1, 2, 3]
57+
}
58+
```
59+
60+
Code that calls the function can use the interface of the protocol, but
61+
does not have visibility into the underlying type.
62+
63+
* [SE-0254][]:
64+
65+
Subscripts can now be declared `static` or (inside classes) `class`.
66+
67+
* [SE-0252][]:
68+
69+
The existing `@dynamicMemberLookup` attribute has been extended with a
70+
support for strongly-typed keypath implementations:
71+
72+
```swift
73+
@dynamicMemberLookup
74+
struct Lens<T> {
75+
let getter: () -> T
76+
let setter: (T) -> Void
77+
78+
var value: T {
79+
get {
80+
return getter()
81+
}
82+
set {
83+
setter(newValue)
84+
}
85+
}
86+
87+
subscript<U>(dynamicMember keyPath: WritableKeyPath<T, U>) -> Lens<U> {
88+
return Lens<U>(
89+
getter: { self.value[keyPath: keyPath] },
90+
setter: { self.value[keyPath: keyPath] = $0 })
91+
}
92+
}
93+
```
94+
95+
* [SR-8546][], [SR-9043][]:
96+
97+
More thorough checking has been implemented for restrictions around
98+
escaping closures capturing `inout` parameters or values of noescape type.
99+
While most code should not be affected, there are edge cases where
100+
the Swift 5.0 compiler would accept code violating these restrictions.
101+
This could result in runtime crashes or silent data corruption.
102+
103+
An example of invalid code which was incorrectly accepted by the Swift 5.0
104+
compiler is an `@escaping` closure calling a local function which
105+
references an `inout` parameter from an outer scope:
106+
107+
```swift
108+
struct BadCaptureExample {
109+
var escapingClosure: () -> ()
110+
111+
mutating func takesInOut(_ x: inout Int) {
112+
func localFunction() {
113+
x += 1
114+
}
115+
116+
escapingClosure = { localFunction() }
117+
}
118+
}
119+
```
120+
121+
The compiler now correctly diagnoses the above code by pointing out that
122+
the capture of `x` by `localFunction()` is invalid, since `localFunction()`
123+
is referenced from an `@escaping` closure.
124+
125+
This also addresses certain cases where the compiler incorrectly diagnosed
126+
certain code as invalid, when in fact no violation of restrictions had
127+
taken place. For example,
128+
129+
```swift
130+
func takesNoEscape(_ fn: () -> ()) {
131+
func localFunction() {
132+
fn()
133+
}
134+
135+
{ localFunction() }()
136+
}
137+
```
138+
139+
* [SR-2672][]:
140+
141+
Conversions between tuple types are now fully implemented.
142+
Previously, the following would diagnose an error:
143+
144+
```swift
145+
let values: (Int, Int) = (10, 15)
146+
let converted: (Int?, Any) = values
147+
148+
* [SE-0242][]:
149+
150+
The memberwise initializer for structures now provide default values for variables that hold default expressions.
151+
152+
```swift
153+
struct Dog {
154+
var name = "Generic dog name"
155+
var age = 0
156+
157+
// The synthesized memberwise initializer
158+
init(name: String = "Generic dog name", age: Int = 0)
159+
}
160+
161+
let sparky = Dog(name: "Sparky") // Dog(name: "Sparky", age: 0)
162+
```
163+
164+
* [SE-0068][]:
165+
166+
It is now possible to use `Self` to refer to the innermost nominal
167+
type inside struct, enum and class declarations. For example, the
168+
two method declarations inside this struct are equivalent:
169+
170+
```swift
171+
struct Box<Value> {
172+
func transform1() -> Self { return self }
173+
func transform2() -> Box<Value> { return self }
174+
}
175+
```
176+
177+
In classes, `Self` is the dynamic type of the `self` value, as before.
178+
Existing restrictions on `Self` in declaration types still apply;
179+
that is, `Self` can only appear as the return type of a method.
180+
However, `Self` can now be used inside the body of a method
181+
without limitation.
182+
183+
* [SR-7799][]:
184+
185+
Enum cases can now be matched against an optional enum without
186+
requiring a '?' at the end of the pattern.
187+
188+
```swift
189+
enum Foo { case zero, one }
190+
191+
let foo: Foo? = .zero
192+
193+
switch foo {
194+
case .zero: break
195+
case .one: break
196+
case .none: break
197+
}
198+
```
199+
200+
* `weak` and `unowned` stored properties no longer inhibit the
201+
automatic synthesis of `Equatable` or `Hashable` conformance.
202+
203+
* [SR-2688][]:
204+
205+
An `@autoclosure` parameter can now be declared with a typealias type.
206+
207+
```swift
208+
class Foo {
209+
typealias FooClosure = () -> String
210+
func fooFunction(closure: @autoclosure FooClosure) {}
211+
}
212+
```
213+
214+
* [SR-7601][]:
215+
216+
Methods declared `@objc` inside a class can now return `Self`:
217+
218+
```swift
219+
class MyClass : NSObject {
220+
@objc func clone() -> Self { return self }
221+
}
222+
```
223+
224+
* [SR-2176][]:
225+
226+
Assigning '.none' to an optional enum which also has a 'none' case
227+
or comparing such an enum with '.none' will now warn. Such expressions
228+
create an ambiguity because the compiler chooses Optional.none
229+
over Foo.none.
230+
231+
```swift
232+
enum Foo { case none }
233+
234+
// Assigned Optional.none instead of Foo.none
235+
let foo: Foo? = .none
236+
// Comparing with Optional.none instead of Foo.none
237+
let isEqual = foo == .none
238+
```
239+
240+
The compiler will provide a warning along with a fix-it to
241+
replace '.none' with 'Optional.none' or 'Foo.none' to resolve
242+
the ambiguity.
243+
244+
* Key path expressions can now include references to tuple elements.
245+
246+
* Single-parameter functions accepting values of type `Any` are no
247+
longer preferred over other functions.
248+
249+
```swift
250+
func foo(_: Any) { print("Any") }
251+
func foo<T>(_: T) { print("T") }
252+
foo(0) // prints "Any" in Swift < 5.1, "T" in Swift 5.1
253+
```
254+
255+
* [SE-0245][]:
256+
257+
`Array` and `ContiguousArray` now have `init(unsafeUninitializedCapacity:initializingWith:)`,
258+
which provides access to the array's uninitialized storage.
259+
260+
**Add new entries to the top of this section, not here!**
261+
24262
Swift 5.0
25263
---------
26264

265+
### 2019-03-25 (Xcode 10.2)
266+
267+
* [SE-0235][]:
268+
269+
The standard library now contains a `Result` type for manually propagating errors.
270+
271+
```swift
272+
enum Result<Success, Failure: Error> {
273+
case success(Success)
274+
case failure(Failure)
275+
}
276+
```
277+
278+
This type serves a complementary role to that of throwing functions and initializers.
279+
Use `Result` in situations where automatic error propagation or `try`-`catch`
280+
blocks are undesirable, such as in asynchronous code or when accumulating the
281+
results of successive error-producing operations.
282+
283+
* `Error` now conforms to itself. This allows for the use of `Error` itself as
284+
the argument for a generic parameter constrained to `Error`.
285+
27286
* Swift 3 mode has been removed. Supported values for the `-swift-version`
28287
flag are `4`, `4.2`, and `5`.
29288

@@ -265,8 +524,6 @@ Swift 5.0
265524
}
266525
```
267526

268-
**Add new entries to the top of this section, not here!**
269-
270527
Swift 4.2
271528
---------
272529

@@ -7406,6 +7663,12 @@ Swift 1.0
74067663
[SE-0227]: <https://github.com/apple/swift-evolution/blob/master/proposals/0227-identity-keypath.md>
74077664
[SE-0228]: <https://github.com/apple/swift-evolution/blob/master/proposals/0228-fix-expressiblebystringinterpolation.md>
74087665
[SE-0230]: <https://github.com/apple/swift-evolution/blob/master/proposals/0230-flatten-optional-try.md>
7666+
[SE-0235]: <https://github.com/apple/swift-evolution/blob/master/proposals/0235-add-result.md>
7667+
[SE-0242]: <https://github.com/apple/swift-evolution/blob/master/proposals/0242-default-values-memberwise.md>
7668+
[SE-0244]: <https://github.com/apple/swift-evolution/blob/master/proposals/0244-opaque-result-types.md>
7669+
[SE-0245]: <https://github.com/apple/swift-evolution/blob/master/proposals/0245-array-uninitialized-initializer.md>
7670+
[SE-0252]: <https://github.com/apple/swift-evolution/blob/master/proposals/0252-keypath-dynamic-member-lookup.md>
7671+
[SE-0254]: <https://github.com/apple/swift-evolution/blob/master/proposals/0254-static-subscripts.md>
74097672

74107673
[SR-106]: <https://bugs.swift.org/browse/SR-106>
74117674
[SR-419]: <https://bugs.swift.org/browse/SR-419>
@@ -7415,12 +7678,20 @@ Swift 1.0
74157678
[SR-1446]: <https://bugs.swift.org/browse/SR-1446>
74167679
[SR-1529]: <https://bugs.swift.org/browse/SR-1529>
74177680
[SR-2131]: <https://bugs.swift.org/browse/SR-2131>
7681+
[SR-2176]: <https://bugs.swift.org/browse/SR-2176>
74187682
[SR-2388]: <https://bugs.swift.org/browse/SR-2388>
74197683
[SR-2394]: <https://bugs.swift.org/browse/SR-2394>
74207684
[SR-2608]: <https://bugs.swift.org/browse/SR-2608>
7685+
[SR-2672]: <https://bugs.swift.org/browse/SR-2672>
7686+
[SR-2688]: <https://bugs.swift.org/browse/SR-2688>
74217687
[SR-4248]: <https://bugs.swift.org/browse/SR-4248>
74227688
[SR-5581]: <https://bugs.swift.org/browse/SR-5581>
74237689
[SR-5719]: <https://bugs.swift.org/browse/SR-5719>
7690+
[SR-6118]: <https://bugs.swift.org/browse/SR-6118>
74247691
[SR-7139]: <https://bugs.swift.org/browse/SR-7139>
74257692
[SR-7251]: <https://bugs.swift.org/browse/SR-7251>
7693+
[SR-7601]: <https://bugs.swift.org/browse/SR-7601>
7694+
[SR-7799]: <https://bugs.swift.org/browse/SR-7799>
74267695
[SR-8109]: <https://bugs.swift.org/browse/SR-8109>
7696+
[SR-8546]: <https://bugs.swift.org/browse/SR-8546>
7697+
[SR-9043]: <https://bugs.swift.org/browse/SR-9043>

0 commit comments

Comments
 (0)