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,25 @@
// !LANGUAGE: +SuspendConversion
// !DIAGNOSTICS: -UNUSED_PARAMETER
fun foo1(f: suspend () -> String) {}
fun foo2(f: suspend (Int) -> String) {}
fun foo3(f: suspend () -> Unit) {}
fun test(
f0: suspend () -> String,
f1: () -> String,
f2: (Int) -> String,
f3: () -> Unit,
) {
foo1 { "str" }
foo1(f0)
foo1(f1)
foo2(f2)
foo3(f3)
}
fun box(): String {
test({ "" }, { "" }, { it.toString() }, {})
return "OK"
}