Move toString() from primitive ranges to Range
The same can't be done with progressions, because its toString() checks if an increment is greater than zero, but Progression.increment is of type Number, which is not Comparable<Int>
This commit is contained in:
@@ -7,10 +7,6 @@ public data class ComparableRange<T: Comparable<T>> (
|
||||
public override fun contains(item: T): Boolean {
|
||||
return start <= item && item <= end
|
||||
}
|
||||
|
||||
public fun toString(): String {
|
||||
return "$start..$end"
|
||||
}
|
||||
}
|
||||
|
||||
public fun <T: Comparable<T>> T.rangeTo(that: T): ComparableRange<T> {
|
||||
|
||||
Reference in New Issue
Block a user