[NI] Improve completing calls with multiple postponed arguments

#KT-27999 Fixed
#KT-30244 Fixed
#KT-31102 Fixed
This commit is contained in:
Dmitriy Novozhilov
2019-12-25 15:25:57 +03:00
parent 0aa527347d
commit 0c01499d98
14 changed files with 206 additions and 46 deletions
@@ -0,0 +1,32 @@
// !LANGUAGE: +NewInference
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE -UNUSED_ANONYMOUS_PARAMETER
fun <K> select(x: K, y: K): K = x
fun <K> select3(x: K, y: K, z: K): K = x
interface A
interface B
fun test() {
select3(
{ a: A, b: A -> Unit },
{ b, a -> Unit },
{ <!UNRESOLVED_REFERENCE!>it<!>; Unit }
)
}
// ISSUE: KT-27999
// ISSUE: KT-30244
fun test_1() {
select(
{ 1 },
{ "" }
)
}
// ISSUE: KT-31102
fun bar(): Int = 1
fun test_2(x: Int) {
val f1: () -> Int = select({ bar() }, ::bar) // TYPE_MISMATCH on lambda
val f2 = select({ bar() }, ::bar) // Same
}