bae8b283c7
^KT-61983 Fixed
35 lines
643 B
Kotlin
Vendored
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()
|
|
}
|
|
}
|
|
}
|