Skip to content

Commit 8ff767a

Browse files
committed
#function
1 parent de0b23e commit 8ff767a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Sources/IdentifiableContinuation.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,14 @@
4444
@_unsafeInheritExecutor
4545
public func withIdentifiableContinuation<T>(
4646
isolation: isolated some Actor,
47+
function: String = #function,
4748
body: (IdentifiableContinuation<T, Never>) -> Void,
4849
onCancel handler: @Sendable (IdentifiableContinuation<T, Never>.ID) -> Void
4950
) async -> T {
5051
let id = IdentifiableContinuation<T, Never>.ID()
5152
let state = AllocatedLock(initialState: (isStarted: false, isCancelled: false))
5253
return await withTaskCancellationHandler {
53-
await withCheckedContinuation {
54+
await withCheckedContinuation(function: function) {
5455
let continuation = IdentifiableContinuation(id: id, continuation: $0)
5556
body(continuation)
5657
let sendCancel = state.withLock {
@@ -88,13 +89,14 @@ public func withIdentifiableContinuation<T>(
8889
@_unsafeInheritExecutor
8990
public func withIdentifiableThrowingContinuation<T>(
9091
isolation: isolated some Actor,
92+
function: String = #function,
9193
body: (IdentifiableContinuation<T, any Error>) -> Void,
9294
onCancel handler: @Sendable (IdentifiableContinuation<T, any Error>.ID) -> Void
9395
) async throws -> T {
9496
let id = IdentifiableContinuation<T, any Error>.ID()
9597
let state = AllocatedLock(initialState: (isStarted: false, isCancelled: false))
9698
return try await withTaskCancellationHandler {
97-
try await withCheckedThrowingContinuation {
99+
try await withCheckedThrowingContinuation(function: function) {
98100
let continuation = IdentifiableContinuation(id: id, continuation: $0)
99101
body(continuation)
100102
let sendCancel = state.withLock {
@@ -123,7 +125,6 @@ public struct IdentifiableContinuation<T, E>: Sendable, Identifiable where E: Er
123125

124126
public final class ID: Hashable, Sendable {
125127

126-
@usableFromInline
127128
init() { }
128129

129130
public func hash(into hasher: inout Hasher) {
@@ -135,7 +136,6 @@ public struct IdentifiableContinuation<T, E>: Sendable, Identifiable where E: Er
135136
}
136137
}
137138

138-
@usableFromInline
139139
init(id: ID, continuation: CheckedContinuation<T, E>) {
140140
self.id = id
141141
self.continuation = continuation

0 commit comments

Comments
 (0)