Files
kotlin-fork/compiler/testData/ir/irText/expressions/callableReferences/constructorWithAdaptedArguments.kt.txt
T

62 lines
937 B
Plaintext
Vendored

fun use(fn: Function1<Int, Any>): Any {
return fn.invoke(p1 = 42)
}
class C {
constructor(vararg xs: Int) /* primary */ {
super/*Any*/()
/* <init>() */
}
}
class Outer {
constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
inner class Inner {
constructor(vararg xs: Int) /* primary */ {
super/*Any*/()
/* <init>() */
}
}
}
fun testConstructor(): Any {
return use(fn = { // BLOCK
local fun <init>(p0: Int): C {
return C(xs = [p0])
}
::<init>
})
}
fun testInnerClassConstructor(outer: Outer): Any {
return use(fn = { // BLOCK
local fun Outer.<init>(p0: Int): Inner {
return receiver.Inner(xs = [p0])
}
outer::<init>
})
}
fun testInnerClassConstructorCapturingOuter(): Any {
return use(fn = { // BLOCK
local fun Outer.<init>(p0: Int): Inner {
return receiver.Inner(xs = [p0])
}
Outer()::<init>
})
}