[IR] dumpKotlinLike: add testdata for FIR tests

This commit is contained in:
Zalim Bashorov
2020-11-20 18:18:14 +03:00
committed by teamcityserver
parent d7bd4240e1
commit c68040753d
298 changed files with 12186 additions and 0 deletions
@@ -0,0 +1,56 @@
fun test1(a: Function0<Unit>) {
when {
a is Runnable -> runStatic(r = a /*as Runnable */)
}
}
fun test2(a: Function0<Unit>) {
when {
a is Runnable -> J().run1(r = a /*as Runnable */)
}
}
fun test3(a: Function0<Unit>) {
when {
a is Runnable -> J().run2(r1 = a /*as Runnable */, r2 = a /*as Runnable */)
}
}
fun test4(a: Function0<Unit>, b: Function0<Unit>) {
when {
a is Runnable -> J().run2(r1 = a /*as Runnable */, r2 = b /*-> Runnable? */)
}
}
fun test5(a: Any) {
when {
a is Runnable -> J().run1(r = a /*as Runnable */)
}
}
fun test5x(a: Any) {
when {
a is Runnable -> { // BLOCK
a /*as Runnable */ as Function0<Unit> /*~> Unit */
J().run1(r = a /*as Runnable */)
}
}
}
fun test6(a: Any) {
a as Function0<Unit> /*~> Unit */
J().run1(r = a /*as Function0<Unit> */ /*-> Runnable? */)
}
fun test7(a: Function1<Int, Int>) {
a as Function0<Unit> /*~> Unit */
error("") /* ERROR CALL */a /*as Function0<Unit> */;
}
fun test8(a: Function0<Unit>) {
error("") /* ERROR CALL */id<Function0<Unit>?>(x = a);
}
fun test9() {
J().run1(r = ::test9 /*-> Runnable? */)
}