[NI] Make behaviour of anonymous functions consistent with lambdas

Fix completion of anonymous functions with expression body without expected type.
Premature completion led to losing type info from outer calls.
Also report type mismatches on empty lambda expressions.

KT-34729 In progress
This commit is contained in:
Pavel Kirpichenkov
2020-01-20 13:47:43 +03:00
parent 4554f91aff
commit 3a98c84105
14 changed files with 185 additions and 13 deletions
@@ -12,7 +12,7 @@ fun test(a: (Int) -> Int) {
}
fun test2(a: () -> List<Int>) {
test2(fun () = <!NI;NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, OI;TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>listOf<!>())
test2(fun () = <!OI;TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>listOf<!>())
}
val a: (Int) -> Unit = fun(x) { checkSubtype<Int>(x) }