FIR DFA: store stability in RealVariable
As part of this change, we also extend the usage of RealVariable in more places during DFA. Now mutable properties, property with custom getters, delegated properties, etc are also treatd as a `RealVariable`. In general this is needed in order to carry out smartcast computation in order to report `SMARTCAST_IMPOSSIBLE`. It seems to also have side effects that improves behavior of some test files.
This commit is contained in:
committed by
TeamCityServer
parent
97ea37c82f
commit
2bb7ef9747
+2
-2
@@ -14,13 +14,13 @@ fun test(u: A?, x: A?, y: A?, z: A?, w: A, v: A?) {
|
||||
u!!.b<!UNNECESSARY_SAFE_CALL!>?.<!>foo()<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>
|
||||
x?.b!!.foo()<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>
|
||||
// x?.b is not null
|
||||
x!!.b<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>.foo()<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>
|
||||
x<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>.b<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>.foo()<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>
|
||||
|
||||
y?.nb?.foo()!!
|
||||
y!!.nb?.foo()!!
|
||||
z?.nb!!.foo()<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>
|
||||
// z?.nb is not null
|
||||
z!!.nb!!.foo()<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>
|
||||
z<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>.nb!!.foo()<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>
|
||||
|
||||
w.b<!UNNECESSARY_SAFE_CALL!>?.<!>foo()<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>
|
||||
w.b<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>.foo()<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>
|
||||
|
||||
+2
-2
@@ -10,6 +10,6 @@ fun failsWithClassCastException() {
|
||||
val sometimesNotInt: Any? by AlternatingDelegate()
|
||||
|
||||
if (sometimesNotInt is Int) {
|
||||
sometimesNotInt.inc()
|
||||
sometimesNotInt.<!UNRESOLVED_REFERENCE!>inc<!>()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -10,6 +10,6 @@ fun failsWithClassCastException() {
|
||||
val sometimesNotInt: Any? by AlternatingDelegate()
|
||||
|
||||
if (sometimesNotInt is Int) {
|
||||
sometimesNotInt.inc()
|
||||
sometimesNotInt.<!UNRESOLVED_REFERENCE!>inc<!>()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -17,7 +17,7 @@ import a.X
|
||||
public fun X.gav(): Int {
|
||||
if (x != null)
|
||||
// Smart cast is not possible if definition is in another module
|
||||
return x.length
|
||||
return x<!UNSAFE_CALL!>.<!>length
|
||||
else
|
||||
return 0
|
||||
}
|
||||
@@ -29,7 +29,7 @@ package a
|
||||
public fun X.gav(): Int {
|
||||
if (x != null)
|
||||
// Even if it's in the same package
|
||||
return x.length
|
||||
return x<!UNSAFE_CALL!>.<!>length
|
||||
else
|
||||
return 0
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user