[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,17 @@
// !WITH_NEW_INFERENCE
// !DIAGNOSTICS: -UNUSED_PARAMETER
// ISSUE: KT-32452
interface A {
suspend fun foo(input: String): String
}
open class B<T : Any> {
fun <U, R : Any, T> call(function: suspend T.(U) -> R): R = TODO()
fun <U, R : Any, T> call(function: suspend T.(U) -> List<R>): List<R> = TODO()
}
class MyService : A, B<A>() {
override suspend fun foo(input: String) = call(A::foo)
}