Add tests for converting expressions of function types to suspending functional types

This commit is contained in:
Victor Petukhov
2021-07-13 15:34:37 +03:00
committed by teamcityserver
parent 780b9a032b
commit 0cc6fbbc6e
30 changed files with 1065 additions and 0 deletions
@@ -0,0 +1,27 @@
// FIR_IDENTICAL
// !LANGUAGE: +SuspendConversion
// !DIAGNOSTICS: -UNUSED_PARAMETER
fun useSuspendVararg(vararg sfn: suspend () -> Unit) {}
fun testSuspendConversionInVarargElementsSome(
sf1: suspend () -> Unit,
f2: () -> Unit,
sf3: suspend () -> Unit
) {
useSuspendVararg(sf1, f2, sf3)
}
fun testSuspendConversionInVarargElementsAll(
f1: () -> Unit,
f2: () -> Unit,
f3: () -> Unit
) {
useSuspendVararg(f1, f2, f3)
}
fun box(): String {
testSuspendConversionInVarargElementsSome({}, {}, {})
testSuspendConversionInVarargElementsAll({}, {}, {})
return "OK"
}