Raw FIR: fix unary operators (now convention calls use receivers)

This commit is contained in:
Simon Ogorodnik
2019-04-16 14:38:44 +03:00
committed by Mikhail Glukhikh
parent 77e83dd8cf
commit 73b1676a03
13 changed files with 106 additions and 79 deletions
@@ -0,0 +1,18 @@
7class U {
operator fun contains(g: String): Boolean {
return false
}
}
fun foo(u: U) {
val b = false
val i = 10
val x = -i
val y = !b
val z = -1.0
val w = +i
val g = "" !in u
val f = "" !is Boolean
}
@@ -0,0 +1,21 @@
FILE: unaryOperators.kt
public final class U : R|kotlin/Any| {
public constructor(): R|U| {
super<R|kotlin/Any|>()
}
public final operator fun contains(g: R|kotlin/String|): R|kotlin/Boolean| {
^contains Boolean(false)
}
}
public final fun foo(u: R|U|): R|kotlin/Unit| {
lval b: R|kotlin/Boolean| = Boolean(false)
lval i: R|kotlin/Int| = Int(10)
lval x: R|kotlin/Int| = R|<local>/i|.R|kotlin/Int.unaryMinus|()
lval y: R|kotlin/Boolean| = R|<local>/b|.R|kotlin/Boolean.not|()
lval z: R|kotlin/Double| = Double(1.0).R|kotlin/Double.unaryMinus|()
lval w: R|kotlin/Int| = R|<local>/i|.R|kotlin/Int.unaryPlus|()
lval g: R|kotlin/Boolean| = R|<local>/u|.R|/U.contains|(String()).R|kotlin/Boolean.not|()
lval f: R|kotlin/Boolean| = (String() !is R|kotlin/Boolean|)
}