Data flow values: initializers for local variables are now stored as "bound values" with inherited nullability #KT-6840 Fixed

This commit is contained in:
Mikhail Glukhikh
2016-07-25 12:03:55 +03:00
parent 7090abddcd
commit 4f7d8e34b0
9 changed files with 74 additions and 26 deletions
@@ -0,0 +1,20 @@
fun foo(arg: Int?) {
val x = arg
if (x != null) {
<!DEBUG_INFO_SMARTCAST!>arg<!>.hashCode()
}
val y: Any? = arg
if (y != null) {
<!DEBUG_INFO_SMARTCAST!>arg<!>.hashCode()
}
val yy: Any?
yy = arg
if (yy != null) {
arg<!UNSAFE_CALL!>.<!>hashCode()
}
var z = arg
z = z?.let { 42 }
if (z != null) {
arg<!UNSAFE_CALL!>.<!>hashCode()
}
}