[NI] Fix passing callable references to suspend functions as functional parameter

#KT-32452
This commit is contained in:
Dmitriy Novozhilov
2019-07-15 13:08:11 +03:00
parent 127be9be03
commit 58b4ab35f0
8 changed files with 111 additions and 1 deletions
@@ -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) {}