Skip to content

Commit adbee7d

Browse files
authored
Update compatibility chapter for Swift 6 (#308)
Fixes: rdar://127062330
2 parents bf8c7cc + 31beef1 commit adbee7d

File tree

1 file changed

+21
-12
lines changed

1 file changed

+21
-12
lines changed

TSPL.docc/GuidedTour/Compatibility.md

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,24 @@
22

33
Learn what functionality is available in older language modes.
44

5-
This book describes Swift 5.10,
6-
the default version of Swift that's included in Xcode 15.3.
7-
You can use Xcode 15.3 to build targets
8-
that are written in either 5.10, Swift 4.2, or Swift 4.
9-
10-
When you use Xcode 15.3 to build Swift 4 and Swift 4.2 code,
11-
most Swift 5.10 functionality is available.
5+
This book describes Swift 6,
6+
the default version of Swift that's included in Xcode XXX.
7+
You can use the Swift 6 compiler to build code
8+
that's written in Swift 6, Swift 5, Swift 4.2, or Swift 4.
9+
10+
When you use the Swift 6 compiler
11+
to build code that uses the Swift 5 language mode,
12+
you can use the new features from Swift 6 ---
13+
they're enabled either by default or by an upcoming feature flag.
14+
However, to enable strict concurrency checking,
15+
you need to upgrade to the Swift 6 language mode.
16+
17+
In addition,
18+
when you use Xcode 15.3 to build Swift 4 and Swift 4.2 code,
19+
most Swift 5 functionality is still available.
1220
That said,
13-
the following changes are available only to code that uses 5.10 or later:
21+
the following changes are available only to code
22+
that uses the Swift 5 language mode:
1423

1524
- Functions that return an opaque type require the Swift 5.1 runtime.
1625
- The `try?` expression doesn't introduce an extra level of optionality
@@ -20,18 +29,18 @@ the following changes are available only to code that uses 5.10 or later:
2029
For example, `UInt64(0xffff_ffff_ffff_ffff)` evaluates to the correct value
2130
rather than overflowing.
2231

23-
Concurrency requires 5.10 or later,
32+
Concurrency requires the Swift 5 language mode
2433
and a version of the Swift standard library
2534
that provides the corresponding concurrency types.
2635
On Apple platforms, set a deployment target
2736
of at least iOS 13, macOS 10.15, tvOS 13, or watchOS 6.
2837

29-
A target written in 5.10 can depend on
30-
a target that's written in Swift 4.2 or Swift 4,
38+
A target written in Swift 6 can depend on
39+
a target that's written in Swift 5, Swift 4.2 or Swift 4,
3140
and vice versa.
3241
This means, if you have a large project
3342
that's divided into multiple frameworks,
34-
you can migrate your code from Swift 4 to 5.10
43+
you can migrate your code to a newer language version
3544
one framework at a time.
3645

3746
<!--

0 commit comments

Comments
 (0)