[NI] Fix passing callable references to suspend functions as functional parameter
#KT-32452
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
// !LANGUAGE: +NewInference
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
// Issue: KT-32256
|
||||
|
||||
fun main() {
|
||||
myMethod(::refA)
|
||||
myMethod(::refB)
|
||||
anotherMethod(::refA)
|
||||
anotherMethod(::refB)
|
||||
}
|
||||
|
||||
suspend fun refA(input: String): String {
|
||||
return input
|
||||
}
|
||||
|
||||
suspend fun refB(): String {
|
||||
return "Hello, World!"
|
||||
}
|
||||
|
||||
fun myMethod(f: suspend (String) -> String) {}
|
||||
|
||||
fun myMethod(f: suspend () -> String) {}
|
||||
|
||||
fun <I, O> anotherMethod(f: suspend (I) -> O) {}
|
||||
|
||||
fun <O> anotherMethod(f: suspend () -> O) {}
|
||||
Reference in New Issue
Block a user