[IR] add testdata for dumpKotlinLike

This commit is contained in:
Zalim Bashorov
2020-11-05 02:47:53 +03:00
committed by teamcityserver
parent d2022ab115
commit 8d5facb15f
365 changed files with 15516 additions and 0 deletions
@@ -0,0 +1,177 @@
fun useSuspend(sfn: SuspendFunction0<Unit>) {
}
fun useSuspendExt(sfn: @ExtensionFunctionType SuspendFunction1<Int, Unit>) {
}
fun useSuspendArg(sfn: SuspendFunction1<Int, Unit>) {
}
fun <T : Any?> useSuspendArgT(sfn: SuspendFunction1<T, Unit>) {
}
fun <T : Any?> useSuspendExtT(sfn: @ExtensionFunctionType SuspendFunction1<T, Unit>) {
}
fun produceFun(): Function0<Unit> {
return local fun <anonymous>() {
return Unit
}
}
fun testSimple(fn: Function0<Unit>) {
useSuspend(sfn = { //BLOCK
local suspend fun suspendConversion0() {
fn.invoke()
}
})
}
fun testSimpleNonVal() {
useSuspend(sfn = { //BLOCK
val tmp0: Function0<Unit> = produceFun()
local suspend fun suspendConversion1() {
tmp0.invoke()
}
})
}
fun testExtAsExt(fn: @ExtensionFunctionType Function1<Int, Unit>) {
useSuspendExt(sfn = { //BLOCK
local suspend fun suspendConversion0(p0: Int) {
fn.invoke(p1 = p0)
}
})
}
fun testExtAsSimple(fn: @ExtensionFunctionType Function1<Int, Unit>) {
useSuspendArg(sfn = { //BLOCK
local suspend fun suspendConversion0(p0: Int) {
fn.invoke(p1 = p0)
}
})
}
fun testSimpleAsExt(fn: Function1<Int, Unit>) {
useSuspendExt(sfn = { //BLOCK
local suspend fun suspendConversion0(p0: Int) {
fn.invoke(p1 = p0)
}
})
}
fun testSimpleAsSimpleT(fn: Function1<Int, Unit>) {
useSuspendArgT<Int>(sfn = { //BLOCK
local suspend fun suspendConversion0(p0: Int) {
fn.invoke(p1 = p0)
}
})
}
fun testSimpleAsExtT(fn: Function1<Int, Unit>) {
useSuspendExtT<Int>(sfn = { //BLOCK
local suspend fun suspendConversion0(p0: Int) {
fn.invoke(p1 = p0)
}
})
}
fun testExtAsSimpleT(fn: @ExtensionFunctionType Function1<Int, Unit>) {
useSuspendArgT<Int>(sfn = { //BLOCK
local suspend fun suspendConversion0(p0: Int) {
fn.invoke(p1 = p0)
}
})
}
fun testExtAsExtT(fn: @ExtensionFunctionType Function1<Int, Unit>) {
useSuspendExtT<Int>(sfn = { //BLOCK
local suspend fun suspendConversion0(p0: Int) {
fn.invoke(p1 = p0)
}
})
}
fun <S : Any?> testSimpleSAsSimpleT(fn: Function1<S, Unit>) {
useSuspendArgT<S>(sfn = { //BLOCK
local suspend fun suspendConversion0(p0: S) {
fn.invoke(p1 = p0)
}
})
}
fun <S : Any?> testSimpleSAsExtT(fn: Function1<S, Unit>) {
useSuspendExtT<S>(sfn = { //BLOCK
local suspend fun suspendConversion0(p0: S) {
fn.invoke(p1 = p0)
}
})
}
fun <S : Any?> testExtSAsSimpleT(fn: @ExtensionFunctionType Function1<S, Unit>) {
useSuspendArgT<S>(sfn = { //BLOCK
local suspend fun suspendConversion0(p0: S) {
fn.invoke(p1 = p0)
}
})
}
fun <S : Any?> testExtSAsExtT(fn: @ExtensionFunctionType Function1<S, Unit>) {
useSuspendExtT<S>(sfn = { //BLOCK
local suspend fun suspendConversion0(p0: S) {
fn.invoke(p1 = p0)
}
})
}
fun testSmartCastWithSuspendConversion(a: Any) {
a as Function0<Unit> /*~> Unit */
useSuspend(sfn = { //BLOCK
local suspend fun suspendConversion0() {
a /*as Function0<Unit> */.invoke()
}
})
}
fun testSmartCastOnVarWithSuspendConversion(a: Any) {
var b: Any = a
b as Function0<Unit> /*~> Unit */
useSuspend(sfn = { //BLOCK
val tmp0: Function0<Unit> = b /*as Function0<Unit> */
local suspend fun suspendConversion1() {
tmp0.invoke()
}
})
}
fun testSmartCastVsSuspendConversion(a: Function0<Unit>) {
a as SuspendFunction0<Unit> /*~> Unit */
useSuspend(sfn = a /*as SuspendFunction0<Unit> */)
}
fun testSmartCastOnVarVsSuspendConversion(a: Function0<Unit>) {
var b: Function0<Unit> = a
b as SuspendFunction0<Unit> /*~> Unit */
useSuspend(sfn = b /*as SuspendFunction0<Unit> */)
}
fun <T> testIntersectionVsSuspendConversion(x: T) where T : Function0<Unit>, T : SuspendFunction0<Unit> {
useSuspend(sfn = x)
}