More accurate handling of "always null" for receivers

This commit is contained in:
Mikhail Glukhikh
2015-11-25 14:14:10 +03:00
parent 89e56093a2
commit 9a6d4c32c5
12 changed files with 45 additions and 32 deletions
@@ -4,7 +4,7 @@ fun foo() {
v = "abc"
<!DEBUG_INFO_SMARTCAST!>v<!>.length
v = null
<!ALWAYS_NULL!>v<!><!UNSAFE_CALL!>.<!>length
<!DEBUG_INFO_CONSTANT!>v<!><!UNSAFE_CALL!>.<!>length
v = "abc"
<!DEBUG_INFO_SMARTCAST!>v<!>.length
}
@@ -3,5 +3,5 @@ fun foo() {
// It is possible in principle to provide smart cast here
v<!UNSAFE_CALL!>.<!>length
v = null
<!ALWAYS_NULL!>v<!><!UNSAFE_CALL!>.<!>length
<!DEBUG_INFO_CONSTANT!>v<!><!UNSAFE_CALL!>.<!>length
}
@@ -1,5 +1,5 @@
fun foo(): Int {
var s: String? = <!VARIABLE_WITH_REDUNDANT_INITIALIZER!>"abc"<!>
s = null
return <!ALWAYS_NULL!>s<!><!UNSAFE_CALL!>.<!>length
return <!DEBUG_INFO_CONSTANT!>s<!><!UNSAFE_CALL!>.<!>length
}