// WITH_STDLIB import kotlin.test.* class Value(val x: Int) : Comparable { override fun compareTo(other: Value): Int { throw AssertionError("Should not be called") } } class ValueRange(override val start: Value, override val endInclusive: Value) : ClosedRange { override fun contains(value: Value): Boolean { return value.x == 42 } } operator fun Value.rangeTo(other: Value): ClosedRange = ValueRange(this, other) fun box(): String { assertTrue(Value(42) in Value(1)..Value(2)) assertTrue(Value(41) !in Value(40)..Value(42)) return "OK" }