diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/11.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/11.fir.kt index 5afcda0cf38..089c8e148a1 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/11.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/11.fir.kt @@ -25,8 +25,8 @@ fun case_3() { var x: Boolean? = true if (x is Boolean) { funWithAnyArg(try { x = null; true } catch (e: Exception) { false }) - x - x.not() + x + x.not() } } @@ -35,8 +35,8 @@ fun case_4() { var x: Boolean? = true if (x != null) { false || when { else -> {x = null; true} } - x - x.not() + x + x.not() } } @@ -57,8 +57,8 @@ fun case_6() { var x: Boolean? = true x as Boolean if (if (true) { x = null; true } else { false }) { - x - x.not() + x + x.not() } } @@ -68,6 +68,6 @@ fun case_7() { x!! if (if (true) { x = null; true } else { false }) {} - x - x.not() + x + x.not() } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/12.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/12.fir.kt index 7c5793032d5..ea31ce80a81 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/12.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/12.fir.kt @@ -6,7 +6,7 @@ fun case_1() { var x: Int? = 11 x!! - try {x = null;} finally { x += 10; } + try {x = null;} finally { x += 10; } } // TESTCASE NUMBER: 2 @@ -18,7 +18,7 @@ fun case_2() { } catch (e: Exception) { x = null } - x.not() + x.not() } } @@ -31,7 +31,7 @@ fun case_3() { } catch (e: Exception) { x = null } - x.not() + x.not() } } @@ -42,5 +42,5 @@ fun case_4() { try { x = null } finally { } - x.not() + x.not() } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/13.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/13.fir.kt index 53307ced28f..6028efb50fe 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/13.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/13.fir.kt @@ -14,16 +14,16 @@ fun case_1(x: Class?) { fun case_2() { var x: Class? = 10 x!! - x(if (true) {x=null;0} else 0, x) - x - x.fun_1() + x(if (true) {x=null;0} else 0, x) + x + x.fun_1() } // TESTCASE NUMBER: 3 fun case_3() { var x: Class? = Class() x!! - val y = x[if (true) {x=null;0} else 0, x[0]] - x - x.fun_1() + val y = x[if (true) {x=null;0} else 0, x[0]] + x + x.fun_1() } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/15.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/15.fir.kt index dc34e80d173..c3035bcc689 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/15.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/15.fir.kt @@ -37,8 +37,8 @@ fun case_3() { var x: Boolean? = true if (x != null) { false || when { else -> { x = null; true} } - x - x.not() + x + x.not() } } @@ -64,7 +64,7 @@ fun case_4() { fun case_5() { var x: Boolean? = true if (x != null) { - when { else -> { x = null; false} } || x.not() + when { else -> { x = null; false} } || x.not() } } @@ -88,7 +88,7 @@ fun case_6() { fun case_7() { var x: Boolean? = true if (x != null) { - (if (true) {x = null; null} else true) ?: x.not() + (if (true) {x = null; null} else true) ?: x.not() } } @@ -96,7 +96,7 @@ fun case_7() { fun case_8(y: MutableList) { var x: Boolean? = true if (x != null) { - y[if (true) {x = null;0} else 0] = x + y[if (true) {x = null;0} else 0] = x } } @@ -109,8 +109,8 @@ fun case_9() { var x: Boolean? = true if (x is Boolean) { funWithAnyArg(try { x = null; true } catch (e: Exception) { false }) - x - x.not() + x + x.not() } } @@ -122,7 +122,7 @@ fun case_9() { fun case_10() { var x: Boolean? = true if (x is Boolean) { - select(if (true) {x = null;Class()} else Class()).prop_9 = x.not() + select(if (true) {x = null;Class()} else Class()).prop_9 = x.not() } } @@ -130,6 +130,6 @@ fun case_10() { fun case_11(y: MutableList>) { var x: Int? = 10 if (x != null) { - y[if (true) {x = null;0} else 0][x] = 10 + y[if (true) {x = null;0} else 0][x] = 10 } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/18.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/18.fir.kt index 0b76ae2e70d..5734223bf9f 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/18.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/18.fir.kt @@ -50,7 +50,7 @@ fun case_4(x: Interface1?) { y as Interface2 y = null fun foo() { - y.itest2() + y.itest2() } y = x foo() @@ -62,7 +62,7 @@ fun case_5(x: Interface1?) { y as Interface2 y = null fun foo() { - y.itest2() + y.itest2() } y = x foo() diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/21.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/21.fir.kt index c52f76a3c8e..359db004c86 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/21.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/21.fir.kt @@ -13,7 +13,7 @@ class Case1 { val y = this if (y.x != null) { x = null - x + x this.x y.x y.x.inv() diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/23.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/23.fir.kt index 5b41b6ef0c2..b3f9d7c25aa 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/23.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/23.fir.kt @@ -31,8 +31,8 @@ inline fun case_3() { var x: T? = 10 as T x = null if (x is K) { - x.equals(10) - x + x.equals(10) + x println(1) } } @@ -61,8 +61,8 @@ inline fun case_6() { var x: T? = 10 as T if (x is K) { x = null - x.equals(10) - x + x.equals(10) + x println(1) } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/24.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/24.fir.kt index 777cc2eeaf5..07df8fe67f9 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/24.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/24.fir.kt @@ -15,8 +15,8 @@ fun case_1() { } catch (e: Exception) { x = null } - x - x.not() + x + x.not() } } @@ -31,8 +31,8 @@ fun case_2() { try { x = null } finally { } - x - x.not() + x + x.not() } } @@ -68,8 +68,8 @@ fun case_4(x: String?) { break } } - x - x.length + x + x.length } /* @@ -85,8 +85,8 @@ fun case_5(x: String?) { break } } while (true) - x - x.length + x + x.length } /* diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/26.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/26.fir.kt index b341660745a..bfdb0be3edd 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/26.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/26.fir.kt @@ -10,18 +10,18 @@ fun case_1() { var x: MutableList? = mutableListOf(1) x!! - & kotlin.collections.MutableList?")!>x[if (true) {x=null;0} else 0] += & kotlin.collections.MutableList?")!>x[0] - & kotlin.collections.MutableList?")!>x - & kotlin.collections.MutableList?")!>x[0].inv() + & kotlin.collections.MutableList?")!>x[if (true) {x=null;0} else 0] += ? & kotlin.collections.MutableList?")!>x[0] + ? & kotlin.collections.MutableList?")!>x + ? & kotlin.collections.MutableList?")!>x[0].inv() } // TESTCASE NUMBER: 2 fun case_2() { var x: MutableList? = mutableListOf(1) x!! - & kotlin.collections.MutableList?")!>x[if (true) {x=null;0} else 0] = & kotlin.collections.MutableList?")!>x[0] - & kotlin.collections.MutableList?")!>x - & kotlin.collections.MutableList?")!>x[0].inv() + & kotlin.collections.MutableList?")!>x[if (true) {x=null;0} else 0] = ? & kotlin.collections.MutableList?")!>x[0] + ? & kotlin.collections.MutableList?")!>x + ? & kotlin.collections.MutableList?")!>x[0].inv() } // TESTCASE NUMBER: 3 @@ -29,8 +29,8 @@ fun case_3() { var x: MutableList? = mutableListOf(1) x!! & kotlin.collections.MutableList?")!>x[0] = if (true) {x=null;0} else 0 - & kotlin.collections.MutableList?")!>x - & kotlin.collections.MutableList?")!>x[0].inv() + ? & kotlin.collections.MutableList?")!>x + ? & kotlin.collections.MutableList?")!>x[0].inv() } /* @@ -41,9 +41,9 @@ fun case_3() { fun case_4() { var x: Class? = Class() x!! - val y = x[if (true) {x=null;0} else 0, x[0]] - x - x[0].inv() + val y = x[if (true) {x=null;0} else 0, x[0]] + x + x[0].inv() } /* @@ -54,17 +54,17 @@ fun case_4() { fun case_5() { var x: Class? = Class() x!! - x(if (true) {x=null;0} else 0, x) - x.fun_1() + x(if (true) {x=null;0} else 0, x) + x.fun_1() } // TESTCASE NUMBER: 6 fun case_6() { var x: MutableList>? = mutableListOf(mutableListOf(1)) x!! - > & kotlin.collections.MutableList>?")!>x[if (true) {x=null;0} else 0][> & kotlin.collections.MutableList>?")!>x[0][0]] += 10 - > & kotlin.collections.MutableList>?")!>x - > & kotlin.collections.MutableList>?")!>x[0][0].inv() + > & kotlin.collections.MutableList>?")!>x[if (true) {x=null;0} else 0][>? & kotlin.collections.MutableList>?")!>x[0][0]] += 10 + >? & kotlin.collections.MutableList>?")!>x + >? & kotlin.collections.MutableList>?")!>x[0][0].inv() } /* @@ -75,22 +75,22 @@ fun case_6() { fun case_7() { var x: Class? = Class() x!! - x(if (true) {x=null;0} else 0)(x) - x.fun_1() + x(if (true) {x=null;0} else 0)(x) + x.fun_1() } // TESTCASE NUMBER: 8 fun case_8() { var x: MutableList>? = mutableListOf(mutableListOf(1)) x!! - > & kotlin.collections.MutableList>?")!>x[if (true) {x=null;0} else 0].addAll(1, > & kotlin.collections.MutableList>?")!>x[0]) + > & kotlin.collections.MutableList>?")!>x[if (true) {x=null;0} else 0].addAll(1, >? & kotlin.collections.MutableList>?")!>x[0]) } // TESTCASE NUMBER: 9 fun case_9() { var x: MutableList>? = mutableListOf(mutableListOf(1)) x!! - > & kotlin.collections.MutableList>?")!>x[if (true) {x=null;0} else 0].subList(0, 2)[> & kotlin.collections.MutableList>?")!>x[0][0]] + > & kotlin.collections.MutableList>?")!>x[if (true) {x=null;0} else 0].subList(0, 2)[>? & kotlin.collections.MutableList>?")!>x[0][0]] } /* @@ -101,7 +101,7 @@ fun case_9() { fun case_10() { var x: MutableList>? = mutableListOf(mutableListOf(1)) x!! - > & kotlin.collections.MutableList>?")!>x.subList(if (true) {x=null;0} else 0, 2)[> & kotlin.collections.MutableList>?")!>x[0][0]] + > & kotlin.collections.MutableList>?")!>x.subList(if (true) {x=null;0} else 0, 2)[>? & kotlin.collections.MutableList>?")!>x[0][0]] } /* @@ -112,5 +112,5 @@ fun case_10() { fun case_11() { var x: MutableList>? = mutableListOf(mutableListOf(1)) x!! - > & kotlin.collections.MutableList>?")!>x[if (true) {x=null;0} else 0].subList(> & kotlin.collections.MutableList>?")!>x[0][0], 2) + > & kotlin.collections.MutableList>?")!>x[if (true) {x=null;0} else 0].subList(>? & kotlin.collections.MutableList>?")!>x[0][0], 2) } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/34.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/34.fir.kt index 0c91dc7abe2..767a3147e0d 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/34.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/34.fir.kt @@ -13,8 +13,8 @@ fun case_1() { x = null break } - x - x.length + x + x.length } /* @@ -28,8 +28,8 @@ fun case_3() { x = null break } - x - x.length + x + x.length } /* @@ -43,8 +43,8 @@ fun case_4() { x = null break } - x - x.not() + x + x.not() } // TESTCASE NUMBER: 5 @@ -56,8 +56,8 @@ fun case_5() { x = null break } - x - x.not() + x + x.not() } // TESTCASE NUMBER: 6 @@ -141,8 +141,8 @@ fun case_12() { x = null break } while (true && x!!) - x - x.not() + x + x.not() } // TESTCASE NUMBER: 13 @@ -154,8 +154,8 @@ fun case_13() { x = null break } while (false && x!!) - x - x.not() + x + x.not() } // TESTCASE NUMBER: 14 @@ -167,8 +167,8 @@ fun case_14() { x = null break } while (true || x!!) - x - x.not() + x + x.not() } // TESTCASE NUMBER: 15 @@ -180,8 +180,8 @@ fun case_15() { x = null break } while (!(false && x!!)) - x - x.not() + x + x.not() } /* @@ -194,8 +194,8 @@ fun case_16() { while (x!! && if (true) {x = null; true} else true) { break } - x - x.not() + x + x.not() } /* @@ -208,6 +208,6 @@ fun case_17() { while (x!! && if (true) {x = null; true} else true) { break } - x - x.not() + x + x.not() } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/35.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/35.fir.kt index ba65a252684..e36e5e01c9b 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/35.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/35.fir.kt @@ -11,8 +11,8 @@ fun case_1() { var x: String? x = "Test" println("${if (true) x = null else 1}") - x - x.length + x + x.length } /* @@ -24,8 +24,8 @@ fun case_2() { var x: String? x = "Test" println("${try { x = null } finally { }}") - x - x.length + x + x.length } /* @@ -37,8 +37,8 @@ fun case_3() { var x: String? x = "Test" println("${try { } finally { x = null }}") - x - x.length + x + x.length } /* @@ -50,8 +50,8 @@ fun case_4() { var x: String? x = "Test" println("${try { x = null } catch (e: Exception) { } finally { }}") - x - x.length + x + x.length } /* @@ -63,8 +63,8 @@ fun case_5() { var x: String? x = "Test" println("${try { } catch (e: Exception) { x = null } finally { }}") - x - x.length + x + x.length } /* @@ -76,8 +76,8 @@ fun case_6() { var x: String? x = "Test" println("${try { } catch (e: Exception) { } finally { x = null }}") - x - x.length + x + x.length } /* @@ -89,8 +89,8 @@ fun case_7() { var x: String? x = "Test" println("${try { x = null } catch (e: Exception) { }}") - x - x.length + x + x.length } /* @@ -102,8 +102,8 @@ fun case_8() { var x: String? x = "Test" println("${try { } catch (e: Exception) { x = null }}") - x - x.length + x + x.length } /* @@ -115,6 +115,6 @@ fun case_9() { var x: String? x = "Test" println("${when (null) { else -> x = null } }") - x - x.length + x + x.length } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/38.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/38.fir.kt index 51b93a755d8..36564f9cf74 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/38.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/38.fir.kt @@ -145,8 +145,8 @@ fun case_9() { inner@ do { x = null } while (x != null) - x - x.length + x + x.length } } @@ -158,8 +158,8 @@ fun case_10() { inner@ do { x = null } while (true) - x - x.length + x + x.length } } @@ -172,7 +172,7 @@ fun case_11() { x = null break } while (x == null) - x - x.length + x + x.length } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/1.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/1.fir.kt index 8a5c7d552ac..bbd90fc5197 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/1.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/1.fir.kt @@ -1293,8 +1293,8 @@ open class Case29(a: Int?, val b: Float?, private val c: Unit?, protected val d: if (w != null || this.w != null) this.w s = null - s.hashCode() - s + s.hashCode() + s if (s != null) s if (this.s != null) s if (s != null || this.s != null) s @@ -2337,8 +2337,8 @@ sealed class Case30(a: Int?, val b: Float?, private val c: Unit?, protected val if (w != null || this.w != null) this.w s = null - s.hashCode() - s + s.hashCode() + s if (s != null) s if (this.s != null) s if (s != null || this.s != null) s @@ -3382,8 +3382,8 @@ enum class Case31(a: Int?, val b: Float?, private val c: Unit?, protected val d: if (w != null || this.w != null) this.w s = null - s.hashCode() - s + s.hashCode() + s if (s != null) s if (this.s != null) s if (s != null || this.s != null) s @@ -4030,8 +4030,8 @@ object Case32 { if (w != null || this.w != null) this.w s = null - s.hashCode() - s + s.hashCode() + s if (s != null) s if (this.s != null) s if (s != null || this.s != null) s diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/52.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/52.fir.kt index 08af6541739..9415700500e 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/52.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/52.fir.kt @@ -12,7 +12,7 @@ fun case_1(x: Int?) = x fun case_1() { var x: Int? = 10 x = null - case_1(x) + case_1(x) } // TESTCASE NUMBER: 2 @@ -21,7 +21,7 @@ fun case_2(x: Nothing?) = x fun case_2() { var x: Int? = 10 x = null - case_2(x) + case_2(x) } // TESTCASE NUMBER: 3 @@ -29,7 +29,7 @@ fun case_3(x: String?) = x fun case_3() { var x: Int? = 10 x = null - case_3(x) + case_3(x) } /* @@ -42,7 +42,7 @@ fun Int?.case_4() = this fun case_4() { var x: Int? = 10 x = null - x.case_4() + x.case_4() } // TESTCASE NUMBER: 5 @@ -51,7 +51,7 @@ fun Nothing?.case_5() = this fun case_5() { var x: Int? = 10 x = null - x.case_5() + x.case_5() } // TESTCASE NUMBER: 6 @@ -59,7 +59,7 @@ fun String?.case_6() = this fun case_6() { var x: Int? = 10 x = null - x.case_6() + x.case_6() } /* @@ -72,7 +72,7 @@ fun T.case_7() = this fun case_7() { var x: Int? = 10 x = null - x.case_7() + x.case_7() } // TESTCASE NUMBER: 8 @@ -81,7 +81,7 @@ fun T.case_8() = this fun case_8() { var x: Int? = 10 x = null - x.case_8() + x.case_8() } // TESTCASE NUMBER: 9 @@ -89,7 +89,7 @@ fun T.case_9() = this fun case_9() { var x: Int? = 10 x = null - x.case_9() + x.case_9() } /* @@ -102,7 +102,7 @@ fun T?.case_10() = this fun case_10() { var x: Int? = 10 x = null - x.case_10() + x.case_10() } // TESTCASE NUMBER: 11 @@ -110,5 +110,5 @@ fun T?.case_11() = this fun case_11() { var x: Int? = 10 x = null - x.case_11() + x.case_11() }