Skip to content

Fix use of Swift 6 language mode #150

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions Sources/Tracing/Tracer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ public func withSpan<T>(
/// - operation: The operation that this span should be measuring
/// - Returns: the value returned by `operation`
/// - Throws: the error the `operation` has thrown (if any)
#if swift(>=6.0)
#if compiler(>=6.0)
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) // for TaskLocal ServiceContext
public func withSpan<T, Instant: TracerInstant>(
_ operationName: String,
Expand All @@ -349,8 +349,10 @@ public func withSpan<T, Instant: TracerInstant>(
}
#endif

#if compiler(>=6.0)
@_disfavoredOverload
@available(*, deprecated, message: "Prefer #isolation version of this API")
#endif
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) // for TaskLocal ServiceContext
public func withSpan<T, Instant: TracerInstant>(
_ operationName: String,
Expand Down Expand Up @@ -398,7 +400,7 @@ public func withSpan<T, Instant: TracerInstant>(
/// - operation: The operation that this span should be measuring
/// - Returns: the value returned by `operation`
/// - Throws: the error the `operation` has thrown (if any)
#if swift(>=6.0)
#if compiler(>=6.0)
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) // for TaskLocal ServiceContext
public func withSpan<T>(
_ operationName: String,
Expand All @@ -424,8 +426,10 @@ public func withSpan<T>(
}
#endif

#if compiler(>=6.0)
@_disfavoredOverload
@available(*, deprecated, message: "Prefer #isolation version of this API")
#endif
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) // for TaskLocal ServiceContext
public func withSpan<T>(
_ operationName: String,
Expand Down Expand Up @@ -473,7 +477,7 @@ public func withSpan<T>(
/// - operation: The operation that this span should be measuring
/// - Returns: the value returned by `operation`
/// - Throws: the error the `operation` has thrown (if any)
#if swift(>=6.0)
#if compiler(>=6.0)
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func withSpan<T>(
_ operationName: String,
Expand All @@ -500,8 +504,10 @@ public func withSpan<T>(
}
#endif

#if compiler(>=6.0)
@_disfavoredOverload
@available(*, deprecated, message: "Prefer #isolation version of this API")
#endif
@available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
public func withSpan<T>(
_ operationName: String,
Expand Down
12 changes: 9 additions & 3 deletions Sources/Tracing/TracerProtocol+Legacy.swift
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ extension LegacyTracer {
/// - operation: The operation that this span should be measuring
/// - Returns: the value returned by `operation`
/// - Throws: the error the `operation` has thrown (if any)
#if swift(>=6.0)
#if compiler(>=6.0)
public func withAnySpan<T, Instant: TracerInstant>(
_ operationName: String,
at instant: @autoclosure () -> Instant,
Expand Down Expand Up @@ -340,8 +340,10 @@ extension LegacyTracer {
}
#endif

#if compiler(>=6.0)
@_disfavoredOverload
@available(*, deprecated, message: "Prefer #isolation version of this API")
#endif
public func withAnySpan<T, Instant: TracerInstant>(
_ operationName: String,
at instant: @autoclosure () -> Instant,
Expand Down Expand Up @@ -397,7 +399,7 @@ extension LegacyTracer {
/// - operation: The operation that this span should be measuring
/// - Returns: the value returned by `operation`
/// - Throws: the error the `operation` has thrown (if any)
#if swift(>=6.0)
#if compiler(>=6.0)
public func withAnySpan<T>(
_ operationName: String,
context: @autoclosure () -> ServiceContext = .current ?? .topLevel,
Expand Down Expand Up @@ -429,8 +431,10 @@ extension LegacyTracer {
}
#endif

#if compiler(>=6.0)
@_disfavoredOverload
@available(*, deprecated, message: "Prefer #isolation version of this API")
#endif
public func withAnySpan<T>(
_ operationName: String,
context: @autoclosure () -> ServiceContext = .current ?? .topLevel,
Expand Down Expand Up @@ -602,7 +606,7 @@ extension Tracer {
/// - operation: The operation that this span should be measuring
/// - Returns: the value returned by `operation`
/// - Throws: the error the `operation` has thrown (if any)
#if swift(>=6.0)
#if compiler(>=6.0)
public func withAnySpan<T>(
_ operationName: String,
at instant: @autoclosure () -> some TracerInstant = DefaultTracerClock.now,
Expand All @@ -628,8 +632,10 @@ extension Tracer {
}
#endif

#if compiler(>=6.0)
@_disfavoredOverload
@available(*, deprecated, message: "Prefer #isolation version of this API")
#endif
public func withAnySpan<T>(
_ operationName: String,
at instant: @autoclosure () -> some TracerInstant = DefaultTracerClock.now,
Expand Down
8 changes: 6 additions & 2 deletions Sources/Tracing/TracerProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ extension Tracer {
/// - operation: The operation that this span should be measuring
/// - Returns: the value returned by `operation`
/// - Throws: the error the `operation` has thrown (if any)
#if swift(>=6.0)
#if compiler(>=6.0)
public func withSpan<T>(
_ operationName: String,
context: @autoclosure () -> ServiceContext = .current ?? .topLevel,
Expand Down Expand Up @@ -274,8 +274,10 @@ extension Tracer {
}
#endif

#if compiler(>=6.0)
@_disfavoredOverload
@available(*, deprecated, message: "Prefer #isolation version of this API")
#endif
public func withSpan<T>(
_ operationName: String,
context: @autoclosure () -> ServiceContext = .current ?? .topLevel,
Expand Down Expand Up @@ -329,7 +331,7 @@ extension Tracer {
/// - operation: The operation that this span should be measuring
/// - Returns: the value returned by `operation`
/// - Throws: the error the `operation` has thrown (if any)
#if swift(>=6.0)
#if compiler(>=6.0)
public func withSpan<T>(
_ operationName: String,
context: @autoclosure () -> ServiceContext = .current ?? .topLevel,
Expand Down Expand Up @@ -362,8 +364,10 @@ extension Tracer {
}
#endif

#if compiler(>=6.0)
@_disfavoredOverload
@available(*, deprecated, message: "Prefer #isolation version of this API")
#endif
public func withSpan<T>(
_ operationName: String,
context: @autoclosure () -> ServiceContext = .current ?? .topLevel,
Expand Down