[FIR] Propagate non-null info for val members, ^KT-44560 Fixed
This commit is contained in:
Vendored
+2
-2
@@ -49,14 +49,14 @@ import contracts.*
|
||||
// TESTCASE NUMBER: 1
|
||||
fun case_1(value_1: Int?) {
|
||||
if (contracts.case_1(value_1)!!) {
|
||||
value_1<!UNSAFE_CALL!>.<!>inv()
|
||||
value_1.inv()
|
||||
}
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 2
|
||||
fun case_2(value_1: Int?) {
|
||||
if (!contracts.case_2(value_1)<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>) {
|
||||
value_1<!UNSAFE_CALL!>.<!>inv()
|
||||
value_1.inv()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,9 +11,9 @@ fun case_1(x: Class?) {
|
||||
if (x!!.prop_8?.prop_8?.prop_8?.prop_8 != null) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Class? & Class")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Class? & Class")!>x<!>.prop_8
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Class? & Class")!>x<!>.prop_8<!UNSAFE_CALL!>.<!>prop_8
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Class? & Class")!>x<!>.prop_8<!UNSAFE_CALL!>.<!>prop_8<!UNSAFE_CALL!>.<!>prop_8
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Class? & Class")!>x<!>.prop_8<!UNSAFE_CALL!>.<!>prop_8<!UNSAFE_CALL!>.<!>prop_8<!UNSAFE_CALL!>.<!>prop_8
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Class? & Class")!>x<!>.prop_8.prop_8
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Class? & Class")!>x<!>.prop_8.prop_8.prop_8
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Class? & Class")!>x<!>.prop_8.prop_8.prop_8.prop_8
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,8 +27,8 @@ fun case_2(x: Class?) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Class? & Class")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Class? & Class")!>x<!>.prop_8
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Class? & Class")!>x<!>.prop_8.prop_8
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Class? & Class")!>x<!>.prop_8.prop_8<!UNSAFE_CALL!>.<!>prop_8
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Class? & Class")!>x<!>.prop_8.prop_8<!UNSAFE_CALL!>.<!>prop_8<!UNSAFE_CALL!>.<!>prop_8
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Class? & Class")!>x<!>.prop_8.prop_8.prop_8
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Class? & Class")!>x<!>.prop_8.prop_8.prop_8.prop_8
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ fun case_3(x: Class?) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Class? & Class")!>x<!>.prop_8
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Class? & Class")!>x<!>.prop_8.prop_8
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Class? & Class")!>x<!>.prop_8.prop_8.prop_8
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Class? & Class")!>x<!>.prop_8.prop_8.prop_8.prop_8<!UNSAFE_CALL!>.<!>prop_8
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Class? & Class")!>x<!>.prop_8.prop_8.prop_8.prop_8.prop_8
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,9 +56,9 @@ fun case_4(x: Class?) {
|
||||
if (<!SAFE_CALL_WILL_CHANGE_NULLABILITY!>x!!<!UNNECESSARY_SAFE_CALL!>?.<!>prop_8<!>?.prop_8?.prop_8?.prop_8 == null == true) else {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Class? & Class")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Class? & Class")!>x<!>.prop_8
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Class? & Class")!>x<!>.prop_8<!UNSAFE_CALL!>.<!>prop_8
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Class? & Class")!>x<!>.prop_8<!UNSAFE_CALL!>.<!>prop_8<!UNSAFE_CALL!>.<!>prop_8
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Class? & Class")!>x<!>.prop_8<!UNSAFE_CALL!>.<!>prop_8<!UNSAFE_CALL!>.<!>prop_8<!UNSAFE_CALL!>.<!>prop_8
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Class? & Class")!>x<!>.prop_8.prop_8
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Class? & Class")!>x<!>.prop_8.prop_8.prop_8
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Class? & Class")!>x<!>.prop_8.prop_8.prop_8.prop_8
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,8 +72,8 @@ fun case_5(x: Class?) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Class? & Class")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Class? & Class")!>x<!>.prop_8
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Class? & Class")!>x<!>.prop_8.prop_8
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Class? & Class")!>x<!>.prop_8.prop_8<!UNSAFE_CALL!>.<!>prop_8
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Class? & Class")!>x<!>.prop_8.prop_8<!UNSAFE_CALL!>.<!>prop_8<!UNSAFE_CALL!>.<!>prop_8
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Class? & Class")!>x<!>.prop_8.prop_8.prop_8
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Class? & Class")!>x<!>.prop_8.prop_8.prop_8.prop_8
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ fun case_6(x: Class?) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Class? & Class")!>x<!>.prop_8
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Class? & Class")!>x<!>.prop_8.prop_8
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Class? & Class")!>x<!>.prop_8.prop_8.prop_8
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Class? & Class")!>x<!>.prop_8.prop_8.prop_8.prop_8<!UNSAFE_CALL!>.<!>prop_8
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Class? & Class")!>x<!>.prop_8.prop_8.prop_8.prop_8.prop_8
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,9 +101,9 @@ fun case_7(x: Class) {
|
||||
if (x<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>.prop_8?.prop_8?.prop_8?.prop_8 != null) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Class")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Class")!>x<!>.prop_8
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Class")!>x<!>.prop_8<!UNSAFE_CALL!>.<!>prop_8
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Class")!>x<!>.prop_8<!UNSAFE_CALL!>.<!>prop_8<!UNSAFE_CALL!>.<!>prop_8
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Class")!>x<!>.prop_8<!UNSAFE_CALL!>.<!>prop_8<!UNSAFE_CALL!>.<!>prop_8<!UNSAFE_CALL!>.<!>prop_8
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Class")!>x<!>.prop_8.prop_8
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Class")!>x<!>.prop_8.prop_8.prop_8
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Class")!>x<!>.prop_8.prop_8.prop_8.prop_8
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,9 +116,9 @@ fun case_8(x: Class) {
|
||||
if (x<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>.prop_8?.prop_8?.prop_8?.prop_8 != null) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Class")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Class")!>x<!>.prop_8
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Class")!>x<!>.prop_8<!UNSAFE_CALL!>.<!>prop_8
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Class")!>x<!>.prop_8<!UNSAFE_CALL!>.<!>prop_8<!UNSAFE_CALL!>.<!>prop_8
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Class")!>x<!>.prop_8<!UNSAFE_CALL!>.<!>prop_8<!UNSAFE_CALL!>.<!>prop_8<!UNSAFE_CALL!>.<!>prop_8
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Class")!>x<!>.prop_8.prop_8
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Class")!>x<!>.prop_8.prop_8.prop_8
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Class")!>x<!>.prop_8.prop_8.prop_8.prop_8
|
||||
}
|
||||
}
|
||||
// TESTCASE NUMBER: 9
|
||||
@@ -136,8 +136,8 @@ fun <T> case_9(x: T) {
|
||||
*/
|
||||
fun <T>case_10(x: Inv<T>?) {
|
||||
if (x!!.prop_1?.prop_1?.prop_1?.prop_2 != null) {
|
||||
x.prop_1<!UNSAFE_CALL!>.<!>prop_1<!UNSAFE_CALL!>.<!>prop_1<!UNSAFE_CALL!>.<!>prop_2
|
||||
x.prop_1<!UNSAFE_CALL!>.<!>prop_1<!UNSAFE_CALL!>.<!>prop_1<!UNSAFE_CALL!>.<!>prop_2<!UNSAFE_CALL!>.<!>equals(10)
|
||||
x.prop_1.prop_1.prop_1.prop_2
|
||||
x.prop_1.prop_1.prop_1.prop_2.equals(10)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -148,8 +148,8 @@ fun <T>case_10(x: Inv<T>?) {
|
||||
*/
|
||||
inline fun <reified T>case_11(x: Inv<T>?) {
|
||||
if (x?.prop_1!!.prop_1?.prop_1?.prop_2 == null) else {
|
||||
x.prop_1.prop_1<!UNSAFE_CALL!>.<!>prop_1<!UNSAFE_CALL!>.<!>prop_2
|
||||
x.prop_1.prop_1<!UNSAFE_CALL!>.<!>prop_1<!UNSAFE_CALL!>.<!>prop_2<!UNSAFE_CALL!>.<!>equals(10)
|
||||
x.prop_1.prop_1.prop_1.prop_2
|
||||
x.prop_1.prop_1.prop_1.prop_2.equals(10)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -161,7 +161,7 @@ inline fun <reified T>case_11(x: Inv<T>?) {
|
||||
fun <T>case_12(x: Inv<T>?) {
|
||||
if (x?.prop_1?.prop_1?.prop_1!!.prop_1 == null) else {
|
||||
x.prop_1.prop_1.prop_1.prop_1
|
||||
x.prop_1.prop_1.prop_1.prop_1<!UNSAFE_CALL!>.<!>equals(10)
|
||||
x.prop_1.prop_1.prop_1.prop_1.equals(10)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -172,7 +172,7 @@ fun <T>case_12(x: Inv<T>?) {
|
||||
*/
|
||||
inline fun <reified T>case_13(x: Out<T>?) {
|
||||
if (x?.prop_1?.prop_1!!.prop_1?.prop_1 != null) {
|
||||
x.prop_1.prop_1.prop_1<!UNSAFE_CALL!>.<!>prop_1
|
||||
x.prop_1.prop_1.prop_1<!UNSAFE_CALL!>.<!>prop_1<!UNSAFE_CALL!>.<!>equals(10)
|
||||
x.prop_1.prop_1.prop_1.prop_1
|
||||
x.prop_1.prop_1.prop_1.prop_1.equals(10)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,8 +109,8 @@ fun case_11(x: Any?) {
|
||||
*/
|
||||
fun case_12(x: Any?) {
|
||||
if (<!CONDITION_TYPE_MISMATCH!>x!! as Boolean?<!>) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>.<!UNRESOLVED_REFERENCE!>not<!>()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any")!>select(x)<!>.<!UNRESOLVED_REFERENCE!>not<!>()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Boolean")!>x<!>.not()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Boolean")!>select(x)<!>.not()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
// TESTCASE NUMBER: 1
|
||||
fun case_1(x: Any?) {
|
||||
if (x!! is Int) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>.<!UNRESOLVED_REFERENCE!>inv<!>()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Int")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Int")!>x<!>.inv()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// TESTCASE NUMBER: 1
|
||||
fun test1(x: ClassLevel1?) {
|
||||
if (x!! is ClassLevel2) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("ClassLevel1? & ClassLevel1")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("ClassLevel1? & ClassLevel1")!>x<!>.<!UNRESOLVED_REFERENCE!>test2<!>()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("ClassLevel1? & ClassLevel2")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("ClassLevel1? & ClassLevel2")!>x<!>.test2()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,6 +37,6 @@ fun case_4(x: Any?) {
|
||||
fun case_5(x: Class) {
|
||||
if (x<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>.prop_8 != null) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Class")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Class")!>x<!>.prop_8<!UNSAFE_CALL!>.<!>prop_8
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Class")!>x<!>.prop_8.prop_8
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user