Skip to content

Commit 3d11679

Browse files
committed
Merge branch 'master' into SR-4347
2 parents 604553f + 0c6f43a commit 3d11679

File tree

629 files changed

+15761
-7196
lines changed

Some content is hidden

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

629 files changed

+15761
-7196
lines changed

.flake8

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
[flake8]
2+
ignore = W291
23
filename = *.py,
34
./utils/80+-check,
45
./utils/backtrace-check,

CHANGELOG.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,39 @@ CHANGELOG
2121
Swift 4.0
2222
---------
2323

24+
* [SR-1529](https://bugs.swift.org/browse/SR-1529):
25+
26+
Covariant method overrides are now fully supported, fixing many crashes
27+
and compile-time assertions when defining or calling such methods.
28+
Examples:
29+
30+
```swift
31+
class Bed {}
32+
class Nook : Bed {}
33+
34+
class Cat<T> {
35+
func eat(snack: T) {}
36+
func play(game: String) {}
37+
func sleep(where: Nook) {}
38+
}
39+
40+
class Dog : Cat<(Int, Int)> {
41+
// 'T' becomes concrete
42+
override func eat(snack: (Int, Int)) {}
43+
44+
// 'game' becomes optional
45+
override func play(game: String?) {}
46+
47+
// 'where' becomes a superclass
48+
override func sleep(where: Bed) {}
49+
}```
50+
2451
* [SE-0148][]:
2552

2653
Subscript declarations can now be defined to have generic parameter lists.
2754
Example:
2855

29-
```
56+
```swift
3057
extension JSON {
3158
subscript<T>(key: String) -> T?
3259
where T : JSONConvertible {
@@ -65,6 +92,8 @@ Swift 4.0
6592
Swift 3.1
6693
---------
6794
95+
### 2017-03-27 (Xcode 8.3)
96+
6897
* [SE-0080][]:
6998
7099
Adds a new family of conversion initializers to all numeric types that

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ option(SWIFT_STDLIB_ENABLE_RESILIENCE
272272

273273
option(SWIFT_RUNTIME_ENABLE_COW_EXISTENTIALS
274274
"Build the runtime with a copy-on-write implementation for opaque existentials"
275-
FALSE)
275+
TRUE)
276276

277277
option(SWIFT_STDLIB_USE_NONATOMIC_RC
278278
"Build the standard libraries and overlays with nonatomic reference count operations enabled"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ discussed below.
5454
macOS, Ubuntu Linux LTS, and the latest Ubuntu Linux release are the current
5555
supported host development operating systems.
5656

57-
For macOS, you need [Xcode 8.3 Beta 4](https://developer.apple.com/xcode/downloads/).
57+
For macOS, you need [Xcode 8.3](https://developer.apple.com/xcode/downloads/).
5858

5959
For Ubuntu, you'll need the following development dependencies:
6060

benchmark/CMakeLists.txt

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,16 @@ set(SWIFT_BENCH_MODULES
3737
single-source/Chars
3838
single-source/ClassArrayGetter
3939
single-source/DeadArray
40+
single-source/DictTest
41+
single-source/DictTest2
42+
single-source/DictTest3
4043
single-source/DictionaryBridge
4144
single-source/DictionaryLiteral
4245
single-source/DictionaryRemove
4346
single-source/DictionarySwap
44-
single-source/DictTest
45-
single-source/DictTest2
46-
single-source/DictTest3
4747
single-source/DropLast
4848
single-source/ErrorHandling
49+
single-source/ExistentialPerformance
4950
single-source/Fibonacci
5051
single-source/GlobalClass
5152
single-source/Hanoi
@@ -61,10 +62,10 @@ set(SWIFT_BENCH_MODULES
6162
single-source/Memset
6263
single-source/MonteCarloE
6364
single-source/MonteCarloPi
64-
single-source/NopDeinit
6565
single-source/NSDictionaryCastToSwift
6666
single-source/NSError
6767
single-source/NSStringConversion
68+
single-source/NopDeinit
6869
single-source/ObjectAllocation
6970
single-source/ObjectiveCBridging
7071
single-source/ObjectiveCBridgingStubs
@@ -81,11 +82,11 @@ set(SWIFT_BENCH_MODULES
8182
single-source/Prims
8283
single-source/ProtocolDispatch
8384
single-source/ProtocolDispatch2
84-
single-source/RangeAssignment
8585
single-source/RC4
86+
single-source/RGBHistogram
87+
single-source/RangeAssignment
8688
single-source/RecursiveOwnedParameter
8789
single-source/ReversedCollections
88-
single-source/RGBHistogram
8990
single-source/SetTests
9091
single-source/SevenBoom
9192
single-source/Sim2DArray
@@ -94,13 +95,13 @@ set(SWIFT_BENCH_MODULES
9495
single-source/StackPromo
9596
single-source/StaticArray
9697
single-source/StrComplexWalk
98+
single-source/StrToInt
9799
single-source/StringBuilder
98100
single-source/StringEdits
99101
single-source/StringInterpolation
100102
single-source/StringMatch
101103
single-source/StringTests
102104
single-source/StringWalk
103-
single-source/StrToInt
104105
single-source/Suffix
105106
single-source/SuperChars
106107
single-source/TwoSum

benchmark/single-source/DictTest.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ class Box<T : Hashable> : Hashable {
157157
return value.hashValue
158158
}
159159

160-
static func ==<T: Equatable>(lhs: Box<T>, rhs: Box<T>) -> Bool {
160+
static func ==(lhs: Box, rhs: Box) -> Bool {
161161
return lhs.value == rhs.value
162162
}
163163
}

benchmark/single-source/DictTest2.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public func run_Dictionary2(_ N: Int) {
3737
CheckResults(res == ref_result, "Incorrect results in Dictionary2: \(res) != \(ref_result)")
3838
}
3939

40-
class Box<T : Hashable> : Hashable where T : Equatable {
40+
class Box<T : Hashable> : Hashable {
4141
var value: T
4242

4343
init(_ v: T) {
@@ -48,7 +48,7 @@ class Box<T : Hashable> : Hashable where T : Equatable {
4848
return value.hashValue
4949
}
5050

51-
static func ==<T: Equatable>(lhs: Box<T>, rhs: Box<T>) -> Bool {
51+
static func ==(lhs: Box, rhs: Box) -> Bool {
5252
return lhs.value == rhs.value
5353
}
5454
}

benchmark/single-source/DictTest3.swift

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,10 @@ class Box<T : Hashable> : Hashable {
5454
var hashValue: Int {
5555
return value.hashValue
5656
}
57-
}
58-
59-
extension Box : Equatable {
60-
}
61-
62-
func ==<T: Equatable>(lhs: Box<T>, rhs: Box<T>) -> Bool {
63-
return lhs.value == rhs.value
57+
58+
static func ==(lhs: Box, rhs: Box) -> Bool {
59+
return lhs.value == rhs.value
60+
}
6461
}
6562

6663
@inline(never)

benchmark/single-source/DictionaryRemove.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class Box<T : Hashable> : Hashable {
5353
return value.hashValue
5454
}
5555

56-
static func ==<T: Equatable>(lhs: Box<T>, rhs: Box<T>) -> Bool {
56+
static func ==(lhs: Box, rhs: Box) -> Bool {
5757
return lhs.value == rhs.value
5858
}
5959
}

benchmark/single-source/DictionarySwap.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class Box<T : Hashable> : Hashable {
5656
return value.hashValue
5757
}
5858

59-
static func ==<T: Equatable>(lhs: Box<T>, rhs: Box<T>) -> Bool {
59+
static func ==(lhs: Box, rhs: Box) -> Bool {
6060
return lhs.value == rhs.value
6161
}
6262
}

0 commit comments

Comments
 (0)