Files
kotlin-fork/compiler/testData/ir/irText/expressions/callableReferences/kt37131.kt.txt
T
2024-02-16 10:19:38 +00:00

42 lines
496 B
Kotlin
Vendored

class C {
val x: String
field = x
get
constructor(x: String = "") /* primary */ {
super/*Any*/()
/* <init>() */
}
}
fun foo(x: String = ""): String {
return x
}
fun testCtor(): Any {
return use(fn = { // BLOCK
local fun <init>(): C {
return C()
}
::<init>
})
}
fun testFn(): Any {
return use(fn = { // BLOCK
local fun foo(): String {
return foo()
}
::foo
})
}
fun use(fn: Function0<Any>): Any {
return fn.invoke()
}