Always null detection
This commit is contained in:
@@ -4,7 +4,7 @@ fun foo() {
|
||||
v = "abc"
|
||||
<!DEBUG_INFO_SMARTCAST!>v<!>.length
|
||||
v = null
|
||||
v<!UNSAFE_CALL!>.<!>length
|
||||
<!ALWAYS_NULL!>v<!><!UNSAFE_CALL!>.<!>length
|
||||
v = "abc"
|
||||
<!DEBUG_INFO_SMARTCAST!>v<!>.length
|
||||
}
|
||||
+1
-1
@@ -3,5 +3,5 @@ fun foo() {
|
||||
// It is possible in principle to provide smart cast here
|
||||
v<!UNSAFE_CALL!>.<!>length
|
||||
v = null
|
||||
v<!UNSAFE_CALL!>.<!>length
|
||||
<!ALWAYS_NULL!>v<!><!UNSAFE_CALL!>.<!>length
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
fun foo(): Int {
|
||||
var i: Int? = <!VARIABLE_WITH_REDUNDANT_INITIALIZER!>42<!>
|
||||
i = null
|
||||
return i <!UNSAFE_INFIX_CALL!>+<!> 1
|
||||
return <!ALWAYS_NULL!>i<!> <!UNSAFE_INFIX_CALL!>+<!> 1
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
fun foo(): Int {
|
||||
var s: String? = <!VARIABLE_WITH_REDUNDANT_INITIALIZER!>"abc"<!>
|
||||
s = null
|
||||
return s<!UNSAFE_CALL!>.<!>length
|
||||
return <!ALWAYS_NULL!>s<!><!UNSAFE_CALL!>.<!>length
|
||||
}
|
||||
Reference in New Issue
Block a user