Skip to content

Commit 5947856

Browse files
committed
Track 'main' to resolve a merge conflict
Re-applied the changes from commit 1b663f7 (Fix invalid HTML comments (swiftlang#334), 2024-12-04) -- which landed on 'main' after this branch diverged -- to the new location for that content. Reviewed this branch's changes, before and after this merge, as follows: opendiff =(git diff main...b6439e7) =(git diff main...HEAD) References: 1b663f7 References: b6439e7
2 parents b6439e7 + e0493a4 commit 5947856

Some content is hidden

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

48 files changed

+929
-431
lines changed

.git-blame-ignore-revs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# changes, which should be ignored by git-blame, so that it can instead
33
# display more the relevant history and attribution information.
44
#
5-
# To use this file for a single blame operation,
5+
# To use this file for a single command, pass it as follows:
66
#
77
# git blame --ignore-revs-file .git-blame-ignore-revs <somefile>
88
#
@@ -14,8 +14,11 @@
1414
# the --ignore-revs-file option, and the git-config(1) man page's
1515
# discussion of the blame.ignoreRevsFile option.
1616

17-
# Convert RST to markdown.
17+
# Convert RST to markdown
1818
96f0925407c6bd9eadd9d58d253bad3e1ef7a9f2
1919

20-
# Convert the formal grammar to markdown.
20+
# Convert the formal grammar to markdown
2121
4039ee0ef4e69d2cf6460861f9444a499503db16
22+
23+
# Clean up formatting of term-definition lists
24+
c914c44ccdbbda757ee43e5d4c777abf24391a1a

.git-order-file

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,5 @@ TSPL.docc/ReferenceManual/SummaryOfTheGrammar.md
6262

6363
TSPL.docc/RevisionHistory/RevisionHistory.md
6464

65-
# Files that don't match a pattern listed above appear at the end.
65+
# Files that don't match a pattern listed above, such as assets and
66+
# build scripts, will appear at the end of the diff.

CODE_OF_CONDUCT.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ but don't rebase commits that are part of a pull request.
4747

4848
## Writing commit messages
4949

50-
Use the Git commit message to communicate with other contributors --
50+
Use the Git commit message to communicate with other contributors
5151
both the people working on the project now
5252
who are reviewing your changes,
5353
and people who join the project in the future

TSPL.docc/GuidedTour/Compatibility.md

Lines changed: 22 additions & 13 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 16.
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
27-
of at least iOS 13, macOS 10.15, tvOS 13, or watchOS 6.
36+
of at least iOS 13, macOS 10.15, tvOS 13, watchOS 6, or visionOS 1.
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
<!--

TSPL.docc/GuidedTour/GuidedTour.md

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ occupations["Jayne"] = "Public Relations"
255255
```swifttest
256256
-> var fruits = ["strawberries", "limes", "tangerines"]
257257
-> fruits[1] = "grapes"
258-
---
258+
259259
-> var occupations = [
260260
"Malcolm": "Captain",
261261
"Kaylee": "Mechanic",
@@ -317,7 +317,7 @@ let emptyDictionary: [String: Float] = [:]
317317
```swifttest
318318
-> let emptyArray: [String] = []
319319
-> let emptyDictionary: [String: Float] = [:]
320-
---
320+
321321
-> let anotherEmptyArray = [String]()
322322
-> let emptyDictionary = [String: Float]()
323323
```
@@ -432,7 +432,7 @@ if let name = optionalName {
432432
-> var optionalString: String? = "Hello"
433433
-> print(optionalString == nil)
434434
<- false
435-
---
435+
436436
-> var optionalName: String? = "John Appleseed"
437437
-> var greeting = "Hello!"
438438
-> if let name = optionalName {
@@ -658,7 +658,7 @@ print(m)
658658
}
659659
-> print(n)
660660
<- 128
661-
---
661+
662662
-> var m = 2
663663
-> repeat {
664664
m *= 2
@@ -1132,11 +1132,11 @@ class NamedShape {
11321132
-> class NamedShape {
11331133
var numberOfSides: Int = 0
11341134
var name: String
1135-
---
1135+
11361136
init(name: String) {
11371137
self.name = name
11381138
}
1139-
---
1139+
11401140
func simpleDescription() -> String {
11411141
return "A shape with \(numberOfSides) sides."
11421142
}
@@ -1202,17 +1202,17 @@ test.simpleDescription()
12021202
```swifttest
12031203
-> class Square: NamedShape {
12041204
var sideLength: Double
1205-
---
1205+
12061206
init(sideLength: Double, name: String) {
12071207
self.sideLength = sideLength
12081208
super.init(name: name)
12091209
numberOfSides = 4
12101210
}
1211-
---
1211+
12121212
func area() -> Double {
12131213
return sideLength * sideLength
12141214
}
1215-
---
1215+
12161216
override func simpleDescription() -> String {
12171217
return "A square with sides of length \(sideLength)."
12181218
}
@@ -1276,13 +1276,13 @@ print(triangle.sideLength)
12761276
```swifttest
12771277
-> class EquilateralTriangle: NamedShape {
12781278
var sideLength: Double = 0.0
1279-
---
1279+
12801280
init(sideLength: Double, name: String) {
12811281
self.sideLength = sideLength
12821282
super.init(name: name)
12831283
numberOfSides = 3
12841284
}
1285-
---
1285+
12861286
var perimeter: Double {
12871287
get {
12881288
return 3.0 * sideLength
@@ -1291,7 +1291,7 @@ print(triangle.sideLength)
12911291
sideLength = newValue / 3.0
12921292
}
12931293
}
1294-
---
1294+
12951295
override func simpleDescription() -> String {
12961296
return "An equilateral triangle with sides of length \(sideLength)."
12971297
}
@@ -1471,7 +1471,7 @@ let aceRawValue = ace.rawValue
14711471
case ace = 1
14721472
case two, three, four, five, six, seven, eight, nine, ten
14731473
case jack, queen, king
1474-
---
1474+
14751475
func simpleDescription() -> String {
14761476
switch self {
14771477
case .ace:
@@ -1562,7 +1562,7 @@ let heartsDescription = hearts.simpleDescription()
15621562
```swifttest
15631563
-> enum Suit {
15641564
case spades, hearts, diamonds, clubs
1565-
---
1565+
15661566
func simpleDescription() -> String {
15671567
switch self {
15681568
case .spades:
@@ -1679,10 +1679,10 @@ case let .failure(message):
16791679
case result(String, String)
16801680
case failure(String)
16811681
}
1682-
---
1682+
16831683
-> let success = ServerResponse.result("6:00 am", "8:09 pm")
16841684
-> let failure = ServerResponse.failure("Out of cheese.")
1685-
---
1685+
16861686
-> switch success {
16871687
case let .result(sunrise, sunset):
16881688
print("Sunrise is at \(sunrise) and sunset is at \(sunset).")
@@ -1910,7 +1910,6 @@ let userID = await server.connect()
19101910
```
19111911
-->
19121912

1913-
19141913
## Protocols and Extensions
19151914

19161915
Use `protocol` to declare a protocol.
@@ -1982,7 +1981,7 @@ let bDescription = b.simpleDescription
19821981
-> let aDescription = a.simpleDescription
19831982
>> print(aDescription)
19841983
<< A very simple class. Now 100% adjusted.
1985-
---
1984+
19861985
-> struct SimpleStructure: ExampleProtocol {
19871986
var simpleDescription: String = "A simple structure"
19881987
mutating func adjust() {
@@ -2309,13 +2308,13 @@ print(fridgeIsOpen)
23092308
```swifttest
23102309
-> var fridgeIsOpen = false
23112310
-> let fridgeContent = ["milk", "eggs", "leftovers"]
2312-
---
2311+
23132312
-> func fridgeContains(_ food: String) -> Bool {
23142313
fridgeIsOpen = true
23152314
defer {
23162315
fridgeIsOpen = false
23172316
}
2318-
---
2317+
23192318
let result = fridgeContent.contains(food)
23202319
return result
23212320
}

0 commit comments

Comments
 (0)