Files
kotlin-fork/compiler/testData/ir/irText/conventionComparisons.kt
T
Dmitry Petrov 1ddf889d8a Comparisons:
- for primitive types and kotlin.String, use IrBinaryOperatorExpression
- for others, use call to 'compareTo'
2016-10-18 09:08:16 +03:00

10 lines
235 B
Kotlin
Vendored

interface IA
interface IB {
operator fun IA.compareTo(other: IA): Int
}
fun IB.test1(a1: IA, a2: IA) = a1 > a2
fun IB.test2(a1: IA, a2: IA) = a1 >= a2
fun IB.test3(a1: IA, a2: IA) = a1 < a2
fun IB.test4(a1: IA, a2: IA) = a1 <= a2