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

70 lines
961 B
Plaintext
Vendored

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