Files
kotlin-fork/compiler/testData/diagnostics/tests/evaluate/infixFunOverBuiltinMemberInConst.kt
T
Andrey Zinovyev b1c8669b43 [FIR] Resolve infix calls to infix functions only
Implements INFIX_MODIFIER_REQUIRED diagnostics
2021-05-20 13:46:27 +03:00

12 lines
349 B
Kotlin
Vendored

// FIR_IDENTICAL
// !DIAGNOSTICS: -UNUSED_VARIABLE, -UNUSED_PARAMETER
infix fun Int.rem(other: Int) = 10
infix operator fun Int.minus(other: Int): Int = 20
const val a1 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>(-5) rem 2<!>
const val a2 = (-5).rem(2)
const val b1 = <!CONST_VAL_WITH_NON_CONST_INITIALIZER!>5 minus 3<!>
const val b2 = 5.minus(3)