[IR] add testdata for dumpKotlinLike
This commit is contained in:
committed by
teamcityserver
parent
d2022ab115
commit
8d5facb15f
+105
@@ -0,0 +1,105 @@
|
||||
fun useSuspend(fn: SuspendFunction0<Unit>) {
|
||||
}
|
||||
|
||||
fun useSuspendInt(fn: SuspendFunction1<Int, Unit>) {
|
||||
}
|
||||
|
||||
suspend fun foo0() {
|
||||
}
|
||||
|
||||
fun foo1() {
|
||||
}
|
||||
|
||||
fun fooInt(x: Int) {
|
||||
}
|
||||
|
||||
fun foo2(vararg xs: Int) {
|
||||
}
|
||||
|
||||
fun foo3(): Int {
|
||||
return 42
|
||||
}
|
||||
|
||||
fun foo4(i: Int = 42) {
|
||||
}
|
||||
|
||||
class C {
|
||||
constructor() /* primary */ {
|
||||
TODO("IrDelegatingConstructorCall")
|
||||
/* InstanceInitializerCall */
|
||||
|
||||
}
|
||||
|
||||
fun bar() {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
fun testLambda() {
|
||||
useSuspend(fn = local suspend fun <anonymous>() {
|
||||
foo1()
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
fun testNoCoversion() {
|
||||
useSuspend(fn = ::foo0)
|
||||
}
|
||||
|
||||
fun testSuspendPlain() {
|
||||
useSuspend(fn = local suspend fun foo1() {
|
||||
foo1()
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
fun testSuspendWithArgs() {
|
||||
useSuspendInt(fn = local suspend fun fooInt(p0: Int) {
|
||||
fooInt(x = p0)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
fun testWithVararg() {
|
||||
useSuspend(fn = local suspend fun foo2() {
|
||||
foo2()
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
fun testWithVarargMapped() {
|
||||
useSuspendInt(fn = local suspend fun foo2(p0: Int) {
|
||||
foo2(xs = [p0])
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
fun testWithCoercionToUnit() {
|
||||
useSuspend(fn = local suspend fun foo3() {
|
||||
foo3() /*~> Unit */
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
fun testWithDefaults() {
|
||||
useSuspend(fn = local suspend fun foo4() {
|
||||
foo4()
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
fun testWithBoundReceiver() {
|
||||
useSuspend(fn = { //BLOCK
|
||||
val tmp0_receiver: C = TODO("IrConstructorCall")
|
||||
local suspend fun C.bar() {
|
||||
receiver.bar()
|
||||
}
|
||||
|
||||
|
||||
::bar
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user