From fd92ceb4317d3adb97421e9aa36bdb533fa7ddd7 Mon Sep 17 00:00:00 2001 From: Artem Chikin Date: Wed, 12 Nov 2025 16:51:26 -0800 Subject: [PATCH] [NFC] Avoid use of unavailable range 'contains' method This method appears to be missing in the host standard library on some CI platforms, still. --- Sources/SwiftWarningControl/WarningControlRegions.swift | 2 +- Tests/SwiftWarningControlTest/WarningControlTests.swift | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/Sources/SwiftWarningControl/WarningControlRegions.swift b/Sources/SwiftWarningControl/WarningControlRegions.swift index 5e045a160e7..8faf4c5901b 100644 --- a/Sources/SwiftWarningControl/WarningControlRegions.swift +++ b/Sources/SwiftWarningControl/WarningControlRegions.swift @@ -254,7 +254,7 @@ private class WarningControlRegionNode { /// Add a child region that is directly nested within this region func addChild(_ node: WarningControlRegionNode) { - precondition(range.contains(node.range)) + precondition(range.lowerBound <= node.range.lowerBound && node.range.upperBound <= range.upperBound) children.append(node) children.sort() } diff --git a/Tests/SwiftWarningControlTest/WarningControlTests.swift b/Tests/SwiftWarningControlTest/WarningControlTests.swift index 5ff48dd9594..acf23b2012d 100644 --- a/Tests/SwiftWarningControlTest/WarningControlTests.swift +++ b/Tests/SwiftWarningControlTest/WarningControlTests.swift @@ -386,8 +386,6 @@ private func assertWarningGroupControl( groupInheritanceTree: groupInheritanceTree ) - print(warningControlRegions.debugDescription) - let groupControl = token.warningGroupControl( for: diagnosticGroupID, globalControls: globalControls,