FIR: initial support of suspend conversion for function reference

This commit is contained in:
Jinseong Jeon
2020-07-24 15:19:28 -07:00
committed by Mikhail Glukhikh
parent b9243aad24
commit 5a3367e09c
21 changed files with 230 additions and 68 deletions
@@ -1,21 +0,0 @@
// !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() {
<!INAPPLICABLE_CANDIDATE!>foo1<!>(::bar1)
<!INAPPLICABLE_CANDIDATE!>foo1<!>(::bar2)
foo1(::bar3) // Should be ambiguity
}