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:
Alexander Udalov
2014-01-15 18:19:36 +04:00
parent d88f76f438
commit ca565b9c19
4 changed files with 2 additions and 20 deletions
-4
View File
@@ -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> {