Support suspend conversion in callable reference adaptation
#KT-15917 In Progress
This commit is contained in:
Vendored
+18
@@ -0,0 +1,18 @@
|
||||
// !LANGUAGE: +SuspendConversion
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
fun foo1(f: suspend () -> Unit) {}
|
||||
fun bar1() {}
|
||||
|
||||
fun <T> foo2(e: T, f: suspend (T) -> Unit) {}
|
||||
fun bar2(x: Int) {}
|
||||
fun bar2(s: String) {}
|
||||
|
||||
fun test() {
|
||||
foo1(::bar1)
|
||||
|
||||
foo2(42, ::bar2)
|
||||
foo2("str", ::bar2)
|
||||
|
||||
foo2(42, <!TYPE_MISMATCH!>::bar1<!>)
|
||||
}
|
||||
Reference in New Issue
Block a user