Postpone call arguments generation in compound assignment expressions

Otherwise RHS is generated twice, causing ISE in symbol binding
This commit is contained in:
Dmitry Petrov
2017-05-04 12:29:38 +03:00
parent 6b956b3746
commit c2601c947f
5 changed files with 99 additions and 5 deletions
+16
View File
@@ -0,0 +1,16 @@
operator fun Any.plusAssign(lambda: () -> Unit) {}
operator fun Any.get(index: () -> Unit): Int = 42
operator fun Any.set(index: () -> Unit, value: Int) {}
fun test1(a: Any) {
a += { }
}
fun test2(a: Any) {
a[{}] += 42
}
fun test3(a: Any) {
a[{}]++
}