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:
@@ -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()
|
||||
Reference in New Issue
Block a user