Files
kotlin-fork/compiler/testData/codegen/box/extensionFunctions/kt3298.kt
T
Steven Schäfer 7d59c7689c 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.
2022-07-14 23:24:18 +02:00

14 lines
281 B
Kotlin
Vendored

var result = ""
fun result(r: String) { result = r }
object Foo {
private operator fun String.unaryPlus() = "(" + this + ")"
fun foo() = { result(+"Stuff") }.let { it() }
}
fun box(): String {
Foo.foo()
return if (result == "(Stuff)") "OK" else "Fail $result"
}