Do not apply constant folding for non built-in functions

#KT-15872 Fixed
This commit is contained in:
Mikhail Zarechenskiy
2017-02-07 20:22:21 +03:00
parent 935f7b1cc1
commit e7ea076093
9 changed files with 68 additions and 0 deletions
@@ -0,0 +1,18 @@
infix fun Int.rem(other: Int) = 10
infix operator fun Int.minus(other: Int): Int = 20
fun box(): String {
val a = 5 rem 2
if (a != 10) return "fail 1"
val b = 5 minus 3
if (b != 20) return "fail 2"
val a1 = 5.rem(2)
if (a1 != 1) return "fail 3"
val b2 = 5.minus(3)
if (b2 != 2) return "fail 4"
return "OK"
}
@@ -0,0 +1,6 @@
@kotlin.Metadata
public final class InfixFunctionOverBuiltinMemberKt {
public final static @org.jetbrains.annotations.NotNull method box(): java.lang.String
public final static method minus(p0: int, p1: int): int
public final static method rem(p0: int, p1: int): int
}