1
1
2
- Swift 3
2
+ Swift 3.0
3
3
-------
4
4
5
5
* Renamification landed, so the Clang importer imports ObjC symbols
@@ -18,10 +18,10 @@ Swift 3
18
18
```
19
19
etc.
20
20
21
- * The @noescape attribute has been extended to be a more general type attribute.
22
- You can now declare values of @noescape function type, e.g. in manually
21
+ * The ` @noescape ` attribute has been extended to be a more general type attribute.
22
+ You can now declare values of ` @noescape ` function type, e.g. in manually
23
23
curried function signatures. You can now also declare local variables of
24
- @noescape type, and use @noescape in typealiases. For example, this is now
24
+ ` @noescape ` type, and use ` @noescape ` in ` typealiases ` . For example, this is now
25
25
valid code:
26
26
27
27
``` swift
@@ -32,8 +32,8 @@ Swift 3
32
32
```
33
33
34
34
* [ SE-0034] ( https://github.com/apple/swift-evolution/blob/master/proposals/0034-disambiguating-line.md )
35
- has renamed the #line directive (which resets the logical source location
36
- for diagnostics and debug information) to #sourceLocation.
35
+ has renamed the ` #line ` directive (which resets the logical source location
36
+ for diagnostics and debug information) to ` #sourceLocation ` .
37
37
38
38
* Curried function syntax has been removed, and now produces a compile-time
39
39
error.
@@ -46,7 +46,7 @@ Swift 3
46
46
```
47
47
48
48
* Section markers are created in ELF binaries through special objects during link time.
49
- These objects allow for the deletion of swift.ld and the use of non-BFD linkers.
49
+ These objects allow for the deletion of ` swift.ld ` and the use of non-BFD linkers.
50
50
A new argument to swiftc is provided to select the linker used, and the gold linker
51
51
is set as the default for arm-based platforms.
52
52
@@ -65,22 +65,22 @@ Swift 3
65
65
Swift 2.2
66
66
---------
67
67
68
- * Associated types in protocols can now be specified with a new ' associatedtype '
69
- declaration, to replace the use of ' typealias ' :
68
+ * Associated types in protocols can now be specified with a new ` associatedtype `
69
+ declaration, to replace the use of ` typealias ` :
70
70
71
71
```swift
72
72
protocol P {
73
73
associatedtype Ty
74
74
}
75
75
```
76
76
77
- The typealias keyword is still allowed (but deprecated and produces a warning)
78
- in Swift 2.2 . This warning will become an error in Swift 3 .
77
+ The ` typealias ` keyword is still allowed (but deprecated and produces a warning)
78
+ in Swift 2.2 . This warning will become an error in Swift 3.0 .
79
79
80
80
* Curried function syntax has been deprecated, and is slated to be removed in
81
- Swift 3 .
81
+ Swift 3.0 .
82
82
83
- * The ++ and -- operators have been deprecated, and are slated to be removed in
83
+ * The ` ++ ` and ` -- ` operators have been deprecated, and are slated to be removed in
84
84
Swift 3.0 . As a replacement, please use `x += 1 ` on integer or floating point
85
85
types, and `x = x.successor ()` on Index types.
86
86
@@ -94,6 +94,7 @@ Swift 2.2
94
94
```
95
95
96
96
should move to being written as :
97
+
97
98
```swift
98
99
foo (x.0, x.b )
99
100
```
@@ -104,7 +105,7 @@ Swift 2.2
104
105
* New `#file `, `#line `, `#column `, and `#function ` expressions have been introduced to
105
106
replace the existing `__FILE__ `, `__LINE__ `, `__COLUMN__ `, and `__FUNCTION__ ` symbols.
106
107
The `__FILE__ `- style symbols have been deprecated, and will be removed in
107
- Swift 3 .
108
+ Swift 3.0 .
108
109
109
110
* The operator identifier lexer grammar has been revised to simplify the rules
110
111
for operators that start with a dot (" ." ). The new rule is that an operator
@@ -156,10 +157,10 @@ Swift 2.2
156
157
157
158
* Global `anyGenerator ()` functions have been changed into initializers on
158
159
`AnyGenerator `, making the API more intuitive and idiomatic. They have been
159
- deprecated in Swift 2.2 , and will be removed in Swift 3 .
160
+ deprecated in Swift 2.2 , and will be removed in Swift 3.0 .
160
161
161
162
* Closures appearing inside generic types and generic methods can now be
162
- converted to C function pointers as long as no generic type parameters
163
+ converted to C function pointers, as long as no generic type parameters
163
164
are referenced in the closure's argument list or body. A conversion of
164
165
a closure that references generic type parameters now produces a
165
166
diagnostic instead of crashing.
@@ -227,7 +228,7 @@ Swift 2.2
227
228
228
229
```swift
229
230
#if swift (>= 2.2 )
230
- // Only this code will be parsed in Swift 3
231
+ // Only this code will be parsed in Swift 3.0
231
232
func foo (x : Int ) -> (y : Int ) -> () {}
232
233
#else
233
234
// This code is ignored entirely.
@@ -253,9 +254,9 @@ Swift 2.2
253
254
254
255
Generally, such string literals should be replaced with uses of
255
256
`#selector `, and the compiler will provide Fix- Its that use
256
- `#selector `. In cases where they is not possible (e.g ., when referring
257
+ `#selector `. In cases where this is not possible (e.g ., when referring
257
258
to the getter of a property), one can still directly construct
258
- selectors, e.g ., :
259
+ selectors, e.g .:
259
260
260
261
```swift
261
262
let sel = Selector (" propertyName" )
@@ -335,7 +336,7 @@ Swift 2.2
335
336
variable of type `String -> Any `. ** (19517003 )**
336
337
337
338
338
- 2015 - 09 - 17 [Xcode 7.0 , Swift 2 ]
339
+ 2015 - 09 - 17 [Xcode 7.0 , Swift 2.0 ]
339
340
----------
340
341
341
342
## Swift Language Features
0 commit comments