[NI] Improve completing callable references with type variable as expected type

#KT-32462 Fixed
This commit is contained in:
Dmitriy Novozhilov
2020-01-15 11:51:53 +03:00
parent 6fe214d825
commit 04ce10b6c1
16 changed files with 233 additions and 40 deletions
@@ -0,0 +1,27 @@
// !LANGUAGE: +NewInference
// !DIAGNOSTICS: -UNUSED_PARAMETER
// ISSUE: KT-32462
fun <K> select(x: K, y: K): K = x
interface A {
fun toB(): B
fun toC(): C
fun toC(x: Int): C
}
interface B
interface C
fun test_1() {
<!DEBUG_INFO_EXPRESSION_TYPE("(A) -> kotlin.Any")!>select(
{ a: A -> a.toB() },
{ a: A -> a.toC() }
)<!>
}
fun test_2() {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.reflect.KFunction1<A, kotlin.Any>")!>select(
A::toB,
A::toC
)<!>
}