Add tests for converting expressions of function types to suspending functional types
This commit is contained in:
committed by
teamcityserver
parent
780b9a032b
commit
0cc6fbbc6e
+36
@@ -0,0 +1,36 @@
|
||||
// !LANGUAGE: +SuspendConversion
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_EXPRESSION
|
||||
|
||||
fun interface SuspendRunnable {
|
||||
suspend fun run()
|
||||
}
|
||||
|
||||
object Test1 {
|
||||
fun call(r: () -> Unit) {}
|
||||
|
||||
object Scope {
|
||||
fun call(r: SuspendRunnable) {}
|
||||
|
||||
fun bar(f: () -> Unit) {
|
||||
<!DEBUG_INFO_CALL("fqName: Test1.call; typeCall: function")!>call(f)<!>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
object Test2 {
|
||||
fun call(r: Runnable) {}
|
||||
|
||||
object Scope {
|
||||
fun call(r: SuspendRunnable) {}
|
||||
|
||||
fun bar(f: () -> Unit) {
|
||||
<!DEBUG_INFO_CALL("fqName: Test2.Scope.call; typeCall: function")!>call(f)<!>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
Test2.Scope.bar { }
|
||||
Test1.Scope.bar { }
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user