Use correct callElement for variable invoke in replacer

Check only 'status.isSuccess' before inlining, no descriptor check
Add two tests and fixes two other
This commit is contained in:
Mikhail Glukhikh
2017-04-11 15:06:03 +03:00
parent 4ef0096d46
commit 6571a573f1
6 changed files with 61 additions and 4 deletions
@@ -0,0 +1,10 @@
class Predicate(val x: Int) {
operator fun invoke() = x
operator fun unaryMinus() = Predicate(-x)
}
fun test(p: Predicate) {
val x = -p
println(<caret>x())
}
@@ -0,0 +1,9 @@
class Predicate(val x: Int) {
operator fun invoke() = x
operator fun unaryMinus() = Predicate(-x)
}
fun test(p: Predicate) {
println((-p)())
}
@@ -0,0 +1,10 @@
class Predicate(val x: Int) {
operator fun set(i: Int, j: Int) {}
operator fun unaryMinus() = Predicate(-x)
}
fun test(p: Predicate) {
val x = -p
<caret>x[13] = 42
}
@@ -0,0 +1,9 @@
class Predicate(val x: Int) {
operator fun set(i: Int, j: Int) {}
operator fun unaryMinus() = Predicate(-x)
}
fun test(p: Predicate) {
(-p)[13] = 42
}