[NI] Remove hack for special functions

Treating special functions for `if`, `when`, `try`, `?:` as not accepting `Nothing` result type is incorrect.
Making so leads to cases with uninferred `Nothing` result type for inner calls and lost data flow info.
This commit is contained in:
Pavel Kirpichenkov
2019-12-26 14:57:47 +03:00
parent 9a12641fde
commit 2d21b82501
18 changed files with 87 additions and 66 deletions
@@ -0,0 +1,11 @@
// !LANGUAGE: +NewInference
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNREACHABLE_CODE
fun test() {
val x: Int? = 20
if (x != null) {
} else {
if (true) return else return
}
x.and(1) // unsafe call
}