Data flow analysis: assignment of null makes variable effectively of type 'Nothing?'

This commit is contained in:
Mikhail Glukhikh
2016-01-20 19:53:43 +03:00
parent 859059d714
commit 366ab508e1
3 changed files with 8 additions and 7 deletions
@@ -1,5 +1,5 @@
fun foo(): Int {
var i: Int? = <!VARIABLE_WITH_REDUNDANT_INITIALIZER!>42<!>
i = null
return <!DEBUG_INFO_CONSTANT!>i<!> <!UNSAFE_INFIX_CALL!>+<!> 1
return <!TYPE_MISMATCH!><!DEBUG_INFO_CONSTANT!>i<!> + 1<!>
}