JVM IR: Avoid direct invokes in callable reference tests
Due to the direct invoke optimization, most callable reference tests were not generating callable references/lambdas.
This commit is contained in:
committed by
Alexander Udalov
parent
f0238766df
commit
7d59c7689c
+1
-1
@@ -6,7 +6,7 @@ infix fun Int.foo(s: Int): Int {
|
||||
return this + s
|
||||
}
|
||||
|
||||
open class B : A({ 1 foo 2} ())
|
||||
open class B : A({ 1 foo 2 }.let { it() })
|
||||
|
||||
fun box(): String {
|
||||
return if (B().s == 3) "OK" else "Fail"
|
||||
|
||||
@@ -3,7 +3,7 @@ class A {
|
||||
init {
|
||||
val flag = "OK"
|
||||
fun getFlag(): String = flag
|
||||
result = { getFlag() } ()
|
||||
result = { getFlag() }.let { it() }
|
||||
}
|
||||
}
|
||||
fun box(): String = A().result
|
||||
|
||||
Reference in New Issue
Block a user