Skip to content

Commit cd63202

Browse files
Merge pull request #2818 from swiftwasm/maxd/main-merge
Resolve conflicts with the main branch
2 parents 4be9673 + 0e56a53 commit cd63202

File tree

861 files changed

+33880
-13528
lines changed

Some content is hidden

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

861 files changed

+33880
-13528
lines changed

.mailmap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Dave <[email protected]>
3535
3636
3737
38-
Dave Lee <davelee@lyft.com> <davelee.com@gmail.com>
38+
Dave Lee <davelee.com@gmail.com> <davelee@lyft.com>
3939
4040
David Rönnqvist <[email protected]>
4141

CHANGELOG.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,31 @@ Swift Next
7575
}
7676
```
7777

78+
* [SE-0297][]:
79+
80+
An Objective-C method that delivers its results asynchronously via a completion handler block will be translated into an `async` method that directly returns the result (or throws). For example, the following Objective-C method from [CloudKit](https://developer.apple.com/documentation/cloudkit/ckcontainer/1640387-fetchshareparticipantwithuserrec):
81+
82+
```objc
83+
- (void)fetchShareParticipantWithUserRecordID:(CKRecordID *)userRecordID
84+
completionHandler:(void (^)(CKShareParticipant * _Nullable, NSError * _Nullable))completionHandler;
85+
```
86+
87+
will be translated into an `async throws` method that returns the participant instance:
88+
89+
```swift
90+
func fetchShareParticipant(
91+
withUserRecordID userRecordID: CKRecord.ID
92+
) async throws -> CKShare.Participant
93+
```
94+
95+
Swift callers can invoke this `async` method within an `await` expression:
96+
97+
```swift
98+
guard let participant = try? await container.fetchShareParticipant(withUserRecordID: user) else {
99+
return nil
100+
}
101+
```
102+
78103
* [SE-0298][]:
79104

80105
The "for" loop can be used to traverse asynchronous sequences in asynchronous code:
@@ -8336,6 +8361,7 @@ Swift 1.0
83368361
[SE-0286]: <https://github.com/apple/swift-evolution/blob/main/proposals/0286-forward-scan-trailing-closures.md>
83378362
[SE-0287]: <https://github.com/apple/swift-evolution/blob/main/proposals/0287-implicit-member-chains.md>
83388363
[SE-0296]: <https://github.com/apple/swift-evolution/blob/main/proposals/0296-async-await.md>
8364+
[SE-0297]: <https://github.com/apple/swift-evolution/blob/main/proposals/0297-concurrency-objc.md>
83398365
[SE-0298]: <https://github.com/apple/swift-evolution/blob/main/proposals/0298-asyncsequence.md>
83408366

83418367
[SR-75]: <https://bugs.swift.org/browse/SR-75>

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ option(USE_SWIFT_ASYNC_LOWERING
201201
functions if it is supported for the target. The runtime also checks
202202
this setting before using async-specific attributes. This only applies
203203
to the async calling convention and not to the async context attribute."
204-
FALSE)
204+
TRUE)
205205

206206
#
207207
# User-configurable Swift Standard Library specific options.

benchmark/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ set(SWIFT_BENCH_MODULES
179179
single-source/StringMatch
180180
single-source/StringRemoveDupes
181181
single-source/StringReplaceSubrange
182+
single-source/StringSplitting
182183
single-source/StringSwitch
183184
single-source/StringTests
184185
single-source/StringWalk

benchmark/single-source/Differentiation.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public func run_DifferentiationIdentity(N: Int) {
4040
x
4141
}
4242
for _ in 0..<1000*N {
43-
blackHole(valueWithGradient(at: 1, in: f))
43+
blackHole(valueWithGradient(at: 1, of: f))
4444
}
4545
}
4646

@@ -50,7 +50,7 @@ public func run_DifferentiationSquare(N: Int) {
5050
x * x
5151
}
5252
for _ in 0..<1000*N {
53-
blackHole(valueWithGradient(at: 1, in: f))
53+
blackHole(valueWithGradient(at: 1, of: f))
5454
}
5555
}
5656

@@ -66,7 +66,7 @@ public func run_DifferentiationArraySum(N: Int) {
6666
return result
6767
}
6868
for _ in 0..<N {
69-
blackHole(valueWithGradient(at: onesArray, in: sum))
69+
blackHole(valueWithGradient(at: onesArray, of: sum))
7070
}
7171
}
7272

0 commit comments

Comments
 (0)