Skip to content

Commit 1059cb8

Browse files
authored
Fix Sendable warning in TokenBucket.swift (#6150)
`CheckedContinuation` is already marked as `Sendable` in Swift 5.6 and later, but with Swift 5.5 on CI we're still seeing warnings related to this.
1 parent fec4bcf commit 1059cb8

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

Sources/Basics/Concurrency/TokenBucket.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
import _Concurrency
1616
import DequeModule
1717

18+
// This type is already marked as `Sendable` in Swift 5.6 and later
19+
#if swift(<5.6)
20+
extension CheckedContinuation: UnsafeSendable {}
21+
#endif
22+
1823
/// Type modeled after a "token bucket" pattern, which is similar to a semaphore, but is built with
1924
/// Swift Concurrency primitives.
2025
public actor TokenBucket {
@@ -63,4 +68,4 @@ public actor TokenBucket {
6368
}
6469
}
6570

66-
#endif
71+
#endif // swift(>=5.5.2)

0 commit comments

Comments
 (0)