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
@@ -5,8 +5,7 @@
fun kt6840_1(s: String?) {
val hash = s?.hashCode()
if (hash != null) {
// To be supported
s<!UNSAFE_CALL!>.<!>length
<!DEBUG_INFO_SMARTCAST!>s<!>.length
}
}
@@ -41,12 +40,11 @@ fun kt4565_1(a: SomeClass?) {
val data = a?.data
if (data != null) {
<!DEBUG_INFO_SMARTCAST!>data<!>.hashCode()
// To be supported
a<!UNSAFE_CALL!>.<!>hashCode()
a<!UNSAFE_CALL!>.<!>data.hashCode()
<!DEBUG_INFO_SMARTCAST!>a<!>.hashCode()
<!DEBUG_INFO_SMARTCAST!>a<!>.data.hashCode()
}
if (a?.data != null) {
// To be supported
// To be supported (?!)
data<!UNSAFE_CALL!>.<!>hashCode()
<!DEBUG_INFO_SMARTCAST!>a<!>.hashCode()
<!DEBUG_INFO_SMARTCAST!>a<!>.data.hashCode()