Add tests for converting expressions of function types to suspending functional types
This commit is contained in:
committed by
teamcityserver
parent
780b9a032b
commit
0cc6fbbc6e
Vendored
+19
@@ -0,0 +1,19 @@
|
||||
// FIR_IDENTICAL
|
||||
// !LANGUAGE: +SuspendConversion
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
fun interface SuspendRunnable {
|
||||
suspend fun invoke()
|
||||
}
|
||||
|
||||
fun foo(s: SuspendRunnable) {}
|
||||
|
||||
fun test(f: () -> Unit) {
|
||||
foo { }
|
||||
foo(f)
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
test({ "" })
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user