Skip to content

Commit 1baec71

Browse files
authored
Enabled ExistentialAny setting (#8)
1 parent 27f8e68 commit 1baec71

2 files changed

Lines changed: 12 additions & 3 deletions

File tree

Package.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,10 @@ let package = Package(
5353
)
5454
]
5555
)
56+
57+
for target in package.targets {
58+
target.swiftSettings = (target.swiftSettings ?? []) + [
59+
.swiftLanguageMode(.v6),
60+
.enableUpcomingFeature("ExistentialAny")
61+
]
62+
}

Sources/PrincipleConcurrency/TaskTimeLimit.swift

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ private enum TaskTimeLimit {
1313

1414
enum Event<Success: Sendable> {
1515

16-
case taskFinished(Result<Success, Error>)
16+
case taskFinished(Result<Success, any Error>)
1717
case parentTaskCancelled
1818
case timeLimitExceeded
1919
}
2020
}
2121

2222
internal func withTimeLimit<C: Clock, Success: Sendable>( // swiftlint:disable:this function_parameter_count
23-
throwing timeLimitExceededError: @autoclosure () -> Error,
23+
throwing timeLimitExceededError: @autoclosure () -> any Error,
2424
after deadline: C.Instant,
2525
tolerance: C.Instant.Duration?,
2626
clock: C,
@@ -32,13 +32,15 @@ internal func withTimeLimit<C: Clock, Success: Sendable>( // swiftlint:disable:t
3232

3333
let result = await withTaskGroup(
3434
of: TaskTimeLimit.Event<Success>.self,
35-
returning: Result<Success, Error>.self,
35+
returning: Result<Success, any Error>.self,
3636
isolation: isolation,
3737
body: { group in
3838
var transfer = transfer.take()
3939

4040
group.addTask(priority: priority) {
4141
do {
42+
// Review after closure isolation control gets implemented
43+
// https://forums.swift.org/t/closure-isolation-control/70378
4244
let success = try await transfer.finalize()()
4345
return .taskFinished(.success(success))
4446
} catch {

0 commit comments

Comments
 (0)