[NI] Coerce to Unit expression in last block with explicit Unit

#KT-32037 Fixed
This commit is contained in:
Mikhail Zarechenskiy
2019-06-18 13:56:00 +03:00
parent 25342240b5
commit 7df13c986e
10 changed files with 72 additions and 19 deletions
+1 -1
View File
@@ -7,7 +7,7 @@ interface A {
fun foo(a: A) {
val <!UNUSED_VARIABLE!>g<!> : () -> Unit = {
a.<!NI;NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>gen<!>() //it works: Unit is derived
a.gen() //it works: Unit is derived
}
val <!UNUSED_VARIABLE!>u<!>: Unit = a.gen() // Unit should be inferred