Skip to content

Commit 6380e56

Browse files
authored
Merge pull request #163 from swhitty/swift-6.2
Swift 6.2
2 parents edc1929 + bcd58ce commit 6380e56

File tree

7 files changed

+29
-62
lines changed

7 files changed

+29
-62
lines changed

.github/workflows/build.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ jobs:
3939
junit: result-swift-testing.xml
4040
coverage: .build/debug/codecov/FlyingFox.json
4141

42-
xcode_16_2:
42+
xcode_26:
4343
runs-on: macos-15
4444
env:
45-
DEVELOPER_DIR: /Applications/Xcode_16.2.app/Contents/Developer
45+
DEVELOPER_DIR: /Applications/Xcode_26.0.app/Contents/Developer
4646
steps:
4747
- name: Checkout
4848
uses: actions/checkout@v4
@@ -53,10 +53,10 @@ jobs:
5353
- name: Test
5454
run: swift test --skip-build
5555

56-
xcode_15_4:
57-
runs-on: macos-14
56+
xcode_16_2:
57+
runs-on: macos-15
5858
env:
59-
DEVELOPER_DIR: /Applications/Xcode_15.4.app/Contents/Developer
59+
DEVELOPER_DIR: /Applications/Xcode_16.2.app/Contents/Developer
6060
steps:
6161
- name: Checkout
6262
uses: actions/checkout@v4
@@ -67,10 +67,10 @@ jobs:
6767
- name: Test
6868
run: swift test --skip-build
6969

70-
xcode_15_2:
70+
xcode_15_4:
7171
runs-on: macos-14
7272
env:
73-
DEVELOPER_DIR: /Applications/Xcode_15.2.app/Contents/Developer
73+
DEVELOPER_DIR: /Applications/Xcode_15.4.app/Contents/Developer
7474
steps:
7575
- name: Checkout
7676
uses: actions/checkout@v4
@@ -94,9 +94,9 @@ jobs:
9494
- name: Test
9595
run: swift test --skip-build
9696

97-
linux_swift_5_9:
97+
linux_swift_6_0:
9898
runs-on: ubuntu-latest
99-
container: swift:5.9
99+
container: swift:6.0
100100
steps:
101101
- name: Checkout
102102
uses: actions/checkout@v4
@@ -107,9 +107,9 @@ jobs:
107107
- name: Test
108108
run: swift test --skip-build
109109

110-
linux_swift_6_0:
110+
linux_swift_6_1:
111111
runs-on: ubuntu-latest
112-
container: swift:6.0
112+
container: swift:6.1.2
113113
steps:
114114
- name: Checkout
115115
uses: actions/checkout@v4
@@ -120,9 +120,9 @@ jobs:
120120
- name: Test
121121
run: swift test --skip-build
122122

123-
linux_swift_6_1:
123+
linux_swift_6_2:
124124
runs-on: ubuntu-latest
125-
container: swift:6.1.2
125+
container: swiftlang/swift:nightly-6.2-noble
126126
steps:
127127
- name: Checkout
128128
uses: actions/checkout@v4

FlyingSocks/Sources/SwiftSupport.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@
2929
// SOFTWARE.
3030
//
3131

32-
#if compiler(<5.10)
33-
#warning("FlyingFox will soon remove support for Swift 5.9")
32+
#if compiler(<6.0)
33+
#warning("FlyingFox will soon remove support for Swift 5.10")
3434
#endif

FlyingSocks/Tests/IdentifiableContinuationTests.swift

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -219,40 +219,30 @@ private actor Waiter<T: Sendable, E: Error> {
219219
}
220220

221221
private func addContinuation(_ continuation: Continuation) {
222-
safeAssertIsolated()
222+
assertIsolated()
223223
waiting[continuation.id] = continuation
224224
}
225225

226226
private func resumeID(_ id: Continuation.ID, returning value: T) {
227-
safeAssertIsolated()
227+
assertIsolated()
228228
if let continuation = waiting.removeValue(forKey: id) {
229229
continuation.resume(returning: value)
230230
}
231231
}
232232

233233
private func resumeID(_ id: Continuation.ID, throwing error: E) {
234-
safeAssertIsolated()
234+
assertIsolated()
235235
if let continuation = waiting.removeValue(forKey: id) {
236236
continuation.resume(throwing: error)
237237
}
238238
}
239239

240240
private func resumeID(_ id: Continuation.ID, with result: Result<T, E>) {
241-
safeAssertIsolated()
241+
assertIsolated()
242242
if let continuation = waiting.removeValue(forKey: id) {
243243
continuation.resume(with: result)
244244
}
245245
}
246-
247-
private func safeAssertIsolated() {
248-
#if compiler(>=5.10)
249-
assertIsolated()
250-
#elseif compiler(>=5.9)
251-
if #available(macOS 14.0, iOS 17.0, watchOS 10.0, tvOS 17.0, *) {
252-
assertIsolated()
253-
}
254-
#endif
255-
}
256246
}
257247

258248
private extension Actor {

FlyingSocks/XCTests/IdentifiableContinuationTests.swift

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -202,40 +202,30 @@ private actor Waiter<T: Sendable, E: Error> {
202202
}
203203

204204
private func addContinuation(_ continuation: Continuation) {
205-
safeAssertIsolated()
205+
assertIsolated()
206206
waiting[continuation.id] = continuation
207207
}
208208

209209
private func resumeID(_ id: Continuation.ID, returning value: T) {
210-
safeAssertIsolated()
210+
assertIsolated()
211211
if let continuation = waiting.removeValue(forKey: id) {
212212
continuation.resume(returning: value)
213213
}
214214
}
215215

216216
private func resumeID(_ id: Continuation.ID, throwing error: E) {
217-
safeAssertIsolated()
217+
assertIsolated()
218218
if let continuation = waiting.removeValue(forKey: id) {
219219
continuation.resume(throwing: error)
220220
}
221221
}
222222

223223
private func resumeID(_ id: Continuation.ID, with result: Result<T, E>) {
224-
safeAssertIsolated()
224+
assertIsolated()
225225
if let continuation = waiting.removeValue(forKey: id) {
226226
continuation.resume(with: result)
227227
}
228228
}
229-
230-
private func safeAssertIsolated() {
231-
#if compiler(>=5.10)
232-
assertIsolated()
233-
#elseif compiler(>=5.9)
234-
if #available(macOS 14.0, iOS 17.0, watchOS 10.0, tvOS 17.0, *) {
235-
assertIsolated()
236-
}
237-
#endif
238-
}
239229
}
240230

241231
private extension Actor {

FlyingSocks/XCTests/Task+TimeoutTests.swift

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,9 @@ final class TaskTimeoutTests: XCTestCase {
149149
@MainActor
150150
func testMainActor_ReturnsValue() async throws {
151151
let val = try await withThrowingTimeout(seconds: 1) {
152-
MainActor.safeAssertIsolated()
152+
MainActor.assertIsolated()
153153
try await Task.sleep(nanoseconds: 1_000)
154-
MainActor.safeAssertIsolated()
154+
MainActor.assertIsolated()
155155
return "Fish"
156156
}
157157
XCTAssertEqual(val, "Fish")
@@ -161,8 +161,8 @@ final class TaskTimeoutTests: XCTestCase {
161161
func testMainActorThrowsError_WhenTimeoutExpires() async {
162162
do {
163163
try await withThrowingTimeout(seconds: 0.05) {
164-
MainActor.safeAssertIsolated()
165-
defer { MainActor.safeAssertIsolated() }
164+
MainActor.assertIsolated()
165+
defer { MainActor.assertIsolated() }
166166
try await Task.sleep(nanoseconds: 60_000_000_000)
167167
}
168168
XCTFail("Expected Error")
@@ -262,21 +262,8 @@ private final actor TestActor<T: Sendable> {
262262
func returningValue(after sleep: TimeInterval = 0, timeout: TimeInterval = 1) async throws -> T {
263263
try await withThrowingTimeout(seconds: timeout) {
264264
try await Task.sleep(nanoseconds: UInt64(sleep * 1_000_000_000))
265-
#if compiler(>=5.10)
266265
self.assertIsolated()
267-
#endif
268266
return self.value
269267
}
270268
}
271269
}
272-
273-
private extension MainActor {
274-
275-
static func safeAssertIsolated() {
276-
#if compiler(>=5.10)
277-
assertIsolated()
278-
#else
279-
precondition(Thread.isMainThread)
280-
#endif
281-
}
282-
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version:5.9
1+
// swift-tools-version:5.10
22

33
import PackageDescription
44

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
FlyingFox can be installed by using Swift Package Manager.
2929

30-
**Note:** FlyingFox requires Swift 5.9 on Xcode 15+. It runs on iOS 13+, tvOS 13+, watchOS 8+, macOS 10.15+ and Linux. Android and Windows 10 support is experimental.
30+
**Note:** FlyingFox requires Swift 5.10 on Xcode 15.4+. It runs on iOS 13+, tvOS 13+, watchOS 8+, macOS 10.15+ and Linux. Android and Windows 10 support is experimental.
3131

3232
To install using Swift Package Manager, add this to the `dependencies:` section in your Package.swift file:
3333

0 commit comments

Comments
 (0)