Files
kotlin-fork/compiler/testData/ir/irText/expressions/variableAsFunctionCall.kt.txt
T
Vladimir Sukharev bae8b283c7 [IR] Normalize temp var names in Kotlin-like dump
^KT-61983 Fixed
2023-10-11 07:49:35 +00:00

35 lines
643 B
Kotlin
Vendored

fun String.k(): Function0<String> {
return local fun <anonymous>(): String {
return <this>
}
}
fun test1(f: Function0<Unit>) {
return f.invoke()
}
fun test2(f: @ExtensionFunctionType Function1<String, Unit>) {
return f.invoke(p1 = "hello")
}
fun test3(): String {
return "hello".k().invoke()
}
fun test4(ns: String?): String? {
return { // BLOCK
val tmp_0: Function0<String>? = { // BLOCK
val tmp_1: String? = ns
when {
EQEQ(arg0 = tmp_1, arg1 = null) -> null
else -> tmp_1.k()
}
}
when {
EQEQ(arg0 = tmp_0, arg1 = null) -> null
else -> tmp_0.invoke()
}
}
}