Skip to content

Commit f6b7db6

Browse files
committed
Fix compilation in Swift 5.10
1 parent 7df3df8 commit f6b7db6

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

Sources/TracingTestKit/TestSpan.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ public struct TestSpan: Span {
3535
}
3636

3737
public var isRecording: Bool {
38-
_isRecording.withValue(\.self)
38+
_isRecording.withValue { $0 }
3939
}
4040

4141
public var operationName: String {
4242
get {
43-
_operationName.withValue(\.self)
43+
_operationName.withValue { $0 }
4444
}
4545
nonmutating set {
4646
assertIsRecording()
@@ -50,7 +50,7 @@ public struct TestSpan: Span {
5050

5151
public var attributes: SpanAttributes {
5252
get {
53-
_attributes.withValue(\.self)
53+
_attributes.withValue { $0 }
5454
}
5555
nonmutating set {
5656
assertIsRecording()
@@ -59,7 +59,7 @@ public struct TestSpan: Span {
5959
}
6060

6161
public var events: [SpanEvent] {
62-
_events.withValue(\.self)
62+
_events.withValue { $0 }
6363
}
6464

6565
public func addEvent(_ event: SpanEvent) {
@@ -68,7 +68,7 @@ public struct TestSpan: Span {
6868
}
6969

7070
public var links: [SpanLink] {
71-
_links.withValue(\.self)
71+
_links.withValue { $0 }
7272
}
7373

7474
public func addLink(_ link: SpanLink) {
@@ -77,7 +77,7 @@ public struct TestSpan: Span {
7777
}
7878

7979
public var errors: [RecordedError] {
80-
_errors.withValue(\.self)
80+
_errors.withValue { $0 }
8181
}
8282

8383
public func recordError(
@@ -92,7 +92,7 @@ public struct TestSpan: Span {
9292
}
9393

9494
public var status: SpanStatus? {
95-
_status.withValue(\.self)
95+
_status.withValue { $0 }
9696
}
9797

9898
public func setStatus(_ status: SpanStatus) {
@@ -138,7 +138,7 @@ public struct TestSpan: Span {
138138
line: UInt = #line
139139
) {
140140
assert(
141-
_isRecording.withValue(\.self) == true,
141+
_isRecording.withValue { $0 } == true,
142142
"Attempted to mutate already ended span.",
143143
file: file,
144144
line: line

Sources/TracingTestKit/TestTracer.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,11 @@ public struct TestTracer: Tracer {
7878
}
7979

8080
public var numberOfForceFlushes: Int {
81-
_numberOfForceFlushes.withValue(\.self)
81+
_numberOfForceFlushes.withValue { $0 }
8282
}
8383

8484
public var finishedSpans: [FinishedTestSpan] {
85-
_finishedSpans.withValue(\.self)
85+
_finishedSpans.withValue { $0 }
8686
}
8787

8888
private let _activeSpans = LockedValueBox<[TestSpanContext: TestSpan]>([:])
@@ -113,7 +113,7 @@ public struct TestTracer: Tracer {
113113
}
114114

115115
public var injections: [Injection] {
116-
_injections.withValue(\.self)
116+
_injections.withValue { $0 }
117117
}
118118

119119
public func extract<Carrier, Extract: Extractor>(
@@ -136,7 +136,7 @@ public struct TestTracer: Tracer {
136136
}
137137

138138
public var extractions: [Extraction] {
139-
_extractions.withValue(\.self)
139+
_extractions.withValue { $0 }
140140
}
141141

142142
public struct Injection: Sendable {

0 commit comments

Comments
 (0)