Skip to content

Commit 37e5c18

Browse files
committed
6.0 only
1 parent f63c708 commit 37e5c18

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

Sources/NIOCore/NIOLoopBound.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ public final class NIOLoopBoundBox<Value>: @unchecked Sendable {
176176
}
177177
}
178178

179+
#if compiler(>=6.0)
179180
/// Safely access and potentially modify the contained value with a closure.
180181
///
181182
/// This method provides a way to perform operations on the contained value while ensuring
@@ -194,4 +195,5 @@ public final class NIOLoopBoundBox<Value>: @unchecked Sendable {
194195
defer { self._value = value }
195196
return try handler(&value)
196197
}
198+
#endif
197199
}

Tests/NIOPosixTests/NIOLoopBoundTests.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ final class NIOLoopBoundTests: XCTestCase {
116116
XCTAssertTrue(loopBoundBox.value.mutateInPlace())
117117
}
118118

119+
#if compiler(>=6.0)
119120
func testWithValue() {
120121
var expectedValue = 0
121122
let loopBound = NIOLoopBoundBox(expectedValue, eventLoop: loop)
@@ -143,6 +144,7 @@ final class NIOLoopBoundTests: XCTestCase {
143144

144145
XCTAssertEqual(10, loopBound.value, "Ensure value is set even if we throw")
145146
}
147+
#endif
146148

147149
// MARK: - Helpers
148150
func sendableBlackhole<S: Sendable>(_ sendableThing: S) {}

0 commit comments

Comments
 (0)