Files
kotlin-fork/compiler/testData/diagnostics/tests/suspendConversion/basicSuspendConversionForCallableReference.fir.kt
T
Kirill Rakhman d91000e39c [FIR] Report INAPPLICABLE_CANDIDATE or more specific diagnostic for callable references
... instead of just UNRESOLVED_REFERENCE when something went wrong
during resolution.

#KT-59401 related
2023-11-08 15:45:48 +00:00

19 lines
338 B
Kotlin
Vendored

// !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, ::<!INAPPLICABLE_CANDIDATE!>bar1<!>)
}