Skip to content

Commit 16fe42c

Browse files
Adjust API Availability for Structured Concurrency Backport (#18)
* Change API availability for concurrency backport * adjust the availability check Co-authored-by: Konrad `ktoso` Malawski <[email protected]> Co-authored-by: Konrad `ktoso` Malawski <[email protected]>
1 parent b0c3e64 commit 16fe42c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Sources/InstrumentationBaggage/Baggage.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,8 @@ extension Baggage {
224224

225225
// MARK: - Propagating Baggage
226226

227-
#if swift(>=5.5)
228-
@available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)
227+
#if swift(>=5.5) && canImport(_Concurrency)
228+
@available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
229229
extension Baggage {
230230
/// A `Baggage` automatically propagated through task-local storage. This API enables binding a top-level `Baggage` and passing it
231231
/// implicitly to any child tasks when using structured concurrency.

Tests/InstrumentationBaggageTests/BaggageTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ final class BaggageTests: XCTestCase {
6363
}
6464

6565
func test_automaticPropagationThroughTaskLocal() throws {
66-
#if swift(>=5.5)
67-
guard #available(macOS 12, iOS 15, tvOS 15, watchOS 8, *) else {
66+
#if swift(>=5.5) && canImport(_Concurrency)
67+
guard #available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) else {
6868
throw XCTSkip("Task locals are not supported on this platform.")
6969
}
7070

0 commit comments

Comments
 (0)