Condition analysis: left part of and (true condition) / or (false condition) is used for right part analysis #KT-8780 Fixed
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
fun foo(x : String?, y : String?) {
|
||||
if (y != null && x == y) {
|
||||
// Both not null
|
||||
<!DEBUG_INFO_SMARTCAST!>x<!>.length
|
||||
<!DEBUG_INFO_SMARTCAST!>y<!>.length
|
||||
}
|
||||
else {
|
||||
x<!UNSAFE_CALL!>.<!>length
|
||||
y<!UNSAFE_CALL!>.<!>length
|
||||
}
|
||||
if (y != null || x == y) {
|
||||
x<!UNSAFE_CALL!>.<!>length
|
||||
y<!UNSAFE_CALL!>.<!>length
|
||||
}
|
||||
else {
|
||||
// y == null but x != y
|
||||
<!DEBUG_INFO_SMARTCAST!>x<!>.length
|
||||
y<!UNSAFE_CALL!>.<!>length
|
||||
}
|
||||
if (y == null && x != y) {
|
||||
// y == null but x != y
|
||||
<!DEBUG_INFO_SMARTCAST!>x<!>.length
|
||||
y<!UNSAFE_CALL!>.<!>length
|
||||
}
|
||||
else {
|
||||
x<!UNSAFE_CALL!>.<!>length
|
||||
y<!UNSAFE_CALL!>.<!>length
|
||||
}
|
||||
if (y == null || x != y) {
|
||||
x<!UNSAFE_CALL!>.<!>length
|
||||
y<!UNSAFE_CALL!>.<!>length
|
||||
}
|
||||
else {
|
||||
// Both not null
|
||||
<!DEBUG_INFO_SMARTCAST!>x<!>.length
|
||||
<!DEBUG_INFO_SMARTCAST!>y<!>.length
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user