when calling function stored in local variable as unary operation, don't forget to push function instance (KT-1953)

I'm sure that there are similar cases that still don't work;  please let me know if you find any
#KT-1953 fixed
This commit is contained in:
Dmitry Jemerov
2012-06-06 17:17:44 +02:00
parent 98c9569216
commit 5b987ccc15
4 changed files with 54 additions and 13 deletions
@@ -0,0 +1,9 @@
fun box(): String {
val sb = StringBuilder()
fun String.plus() {
sb.append(this)
}
+"OK"
return sb.toString()!!
}
@@ -0,0 +1,14 @@
class A {
private val sb: StringBuilder = StringBuilder()
fun String.plus {
sb.append(this)
}
fun foo(): String {
+"OK"
return sb.toString()!!
}
}
fun box(): String = A().foo()