Files
kotlin-fork/idea/testData/inspectionsLocal/convertTwoComparisonsToRangeCheck/recursiveCall.kt
T
2020-10-23 15:46:52 +09:00

22 lines
562 B
Kotlin
Vendored

// PROBLEM: none
// WITH_RUNTIME
class TimeIndex(val intValue: Int) : Comparable<TimeIndex> {
override fun compareTo(other: TimeIndex): Int {
TODO()
}
operator fun rangeTo(other: TimeIndex): TimeIndexRange {
return TimeIndexRange(this, other)
}
}
data class TimeIndexRange(val start: TimeIndex, val end: TimeIndex) : Iterable<TimeIndex> {
override fun iterator(): Iterator<TimeIndex> {
TODO()
}
operator fun contains(index: TimeIndex): Boolean {
return <caret>start <= index && index <= end
}
}