Skip to content

Commit df7520f

Browse files
committed
fix warning
1 parent 1cc2df3 commit df7520f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Sources/Task+SleepIndefinitely.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@
3333

3434
package extension Task<Never, Never> {
3535

36-
private typealias State = (isCancelled: Bool, continuation: CheckedContinuation<Never, any Error>?)
36+
private typealias State = (isCancelled: Bool, continuation: CheckedContinuation<Void, any Error>?)
3737

3838
static func sleepIndefinitely() async throws -> Never {
3939
let state = Mutex<State>((isCancelled: false, continuation: nil))
40-
return try await withTaskCancellationHandler {
40+
try await withTaskCancellationHandler {
4141
try await withCheckedThrowingContinuation { continuation in
4242
let isCancelled = state.withLock {
4343
if $0.isCancelled {
@@ -58,6 +58,7 @@ package extension Task<Never, Never> {
5858
}
5959
continuation?.resume(throwing: _Concurrency.CancellationError())
6060
}
61+
fatalError("can never occur")
6162
}
6263
}
6364

0 commit comments

Comments
 (0)