[NI] Fix exception, recorded type for function statement can be null

See `checkStatementType`, we return `null` to reduce count of errors.

 Also, note that named function which is used as last statement in lambda
 doesn't coerce to Unit, this is a separate bug and will be addressed later,
 see #KT-25383

 #EA-121026 Fixed
This commit is contained in:
Mikhail Zarechenskiy
2018-07-10 13:13:03 +03:00
parent eb745133c9
commit 2be08f4d60
6 changed files with 35 additions and 6 deletions
@@ -0,0 +1,10 @@
// !LANGUAGE: +NewInference
fun bar() {
if (true) <!TYPE_MISMATCH!>{
<!EXPECTED_TYPE_MISMATCH!>fun local() {
}<!>
}<!> else {
}
}