Support suspend conversion in callable reference adaptation

#KT-15917 In Progress
This commit is contained in:
Mikhail Zarechenskiy
2020-04-22 04:51:07 +03:00
parent 537a59d6ca
commit ac642cf175
13 changed files with 221 additions and 3 deletions
@@ -0,0 +1,21 @@
// !LANGUAGE: +SuspendConversion
// !DIAGNOSTICS: -UNUSED_PARAMETER
fun interface SuspendRunnable {
suspend fun invoke()
}
fun foo1(s: SuspendRunnable) {}
fun bar1() {}
fun bar2(s: String = ""): Int = 0
fun bar3() {}
suspend fun bar3(s: String = ""): Int = 0
fun test() {
foo1(::bar1)
foo1(::bar2)
foo1(::bar3) // Should be ambiguity
}