Skip to content

Commit 0825a1e

Browse files
committed
Merge pull request #2907 from apple/stdlib-migration
2 parents 23d586c + 3ce1f98 commit 0825a1e

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

stdlib/public/core/Range.swift.gyb

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,24 @@ extension Range {
603603
}
604604
}
605605

606+
extension ClosedRange {
607+
@available(*, unavailable, message: "Call clamped(to:) and swap the argument and the receiver. For example, x.clamp(y) becomes y.clamped(to: x) in Swift 3.")
608+
public func clamp(
609+
_ intervalToClamp: ClosedRange<Bound>
610+
) -> ClosedRange<Bound> {
611+
Builtin.unreachable()
612+
}
613+
}
614+
615+
extension CountableClosedRange {
616+
@available(*, unavailable, message: "Call clamped(to:) and swap the argument and the receiver. For example, x.clamp(y) becomes y.clamped(to: x) in Swift 3.")
617+
public func clamp(
618+
_ intervalToClamp: CountableClosedRange<Bound>
619+
) -> CountableClosedRange<Bound> {
620+
Builtin.unreachable()
621+
}
622+
}
623+
606624
@available(*, unavailable, message: "IntervalType has been removed in Swift 3. Use ranges instead.")
607625
public typealias IntervalType = Void
608626

0 commit comments

Comments
 (0)