diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/11.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/11.kt index 2469667a939..fb5f7956566 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/11.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/11.kt @@ -51,12 +51,16 @@ fun case_4() { } } -// TESTCASE NUMBER: 5 +/* + * TESTCASE NUMBER: 5 + * UNEXPECTED BEHAVIOUR + * ISSUES: KT-35668, KT-35668 + */ fun case_5() { var x: Int? = null - if (x == try { x = 10; null } finally {} && x != null) { - x - x.inv() + if (x == try { x = 10; null } finally {} && x != null) { + x + x.inv() } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/15.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/15.kt index 868b872011f..4afcf54e5ce 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/15.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/15.kt @@ -54,14 +54,14 @@ fun case_3() { /* * TESTCASE NUMBER: 4 * UNEXPECTED BEHAVIOUR - * ISSUES: KT-28369 + * ISSUES: KT-28369, KT-35668 */ fun case_4() { var x: Int? = null - if (x == try { x = 10; null } finally {} && x != null) { - x - x.inv() - println(1) + if (x == try { x = 10; null } finally {} && x != null) { + x + x.inv() + println(1) } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/32.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/32.kt index c17b97b8b40..c4b300ccca2 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/32.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/32.kt @@ -17,24 +17,24 @@ fun stringArg(number: String) {} /* * TESTCASE NUMBER: 1 * UNEXPECTED BEHAVIOUR - * ISSUES: KT-27464 + * ISSUES: KT-27464, KT-35668 */ fun case_1(x: Int?) { if (x == null) { - stringArg(x!!) - x + stringArg(x!!) + x } } /* * TESTCASE NUMBER: 2 * UNEXPECTED BEHAVIOUR - * ISSUES: KT-27464 + * ISSUES: KT-27464, KT-35668 */ fun case_2(x: Int?, y: Nothing?) { if (x == y) { - stringArg(x!!) - x + stringArg(x!!) + x } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/33.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/33.kt index b0ef6d5a97c..477fd3756b8 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/33.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/33.kt @@ -81,7 +81,11 @@ fun case_5() { x.minus(10.0) } -// TESTCASE NUMBER: 6 +/* + * TESTCASE NUMBER: 6 + * UNEXPECTED BEHAVIOUR + * ISSUES: KT-35668 + */ fun case_6() { val x: Any? @@ -91,6 +95,6 @@ fun case_6() { null!! } - x - x.minus(10.0) + x + x.minus(10.0) } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/35.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/35.kt index 55a2191160c..917f40abca0 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/35.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/35.kt @@ -39,11 +39,11 @@ fun case_2(x: Any?) { /* * TESTCASE NUMBER: 3 * UNEXPECTED BEHAVIOUR - * ISSUES: KT-30756 + * ISSUES: KT-30756, KT-35668 */ fun case_3(x: Any?) { while (true) { - x ?: return ?: x + x ?: return ?: x } x diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/36.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/36.kt index ad2d7047c63..1eb882be842 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/36.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/36.kt @@ -80,31 +80,43 @@ fun case_5(x: Any?) { } } -// TESTCASE NUMBER: 6 +/* + * TESTCASE NUMBER: 6 + * UNEXPECTED BEHAVIOUR + * ISSUES: KT-35668 + */ fun case_6(x: Any?) { var y = x ?: null!! while (false || y is Number) { - x + x y y.toByte() } } -// TESTCASE NUMBER: 7 +/* + * TESTCASE NUMBER: 7 + * UNEXPECTED BEHAVIOUR + * ISSUES: KT-35668 + */ fun case_7(x: Any?, z: Any) { var y = x ?: null!! while (false || y === z) { - x + x y y.equals(10) } } -// TESTCASE NUMBER: 8 +/* + * TESTCASE NUMBER: 8 + * UNEXPECTED BEHAVIOUR + * ISSUES: KT-35668 + */ fun case_8(x: Any?, z: Any) { var y = x ?: null!! y == z || return - x + x y y.equals(10) } @@ -118,15 +130,19 @@ fun case_9(x: Any?, z: Any) { y.equals(10) } -// TESTCASE NUMBER: 10 +/* + * TESTCASE NUMBER: 6 + * UNEXPECTED BEHAVIOUR + * ISSUES: KT-35668 + */ fun case_10(x: Any?, z: Any, b: Boolean?) { - var y = x ?: when (b) { + var y = x ?: when (b) { true -> null!! false -> return null -> throw Exception() - } + } z === y || if (b == true) return else if (b === false) null!! else throw Exception() - x + x y y.equals(10) } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/37.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/37.kt index a2faa2b0732..7117529817c 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/37.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/37.kt @@ -39,11 +39,11 @@ fun case_2(a: Any?) { /* * TESTCASE NUMBER: 3 * UNEXPECTED BEHAVIOUR - * ISSUES: KT-30756 + * ISSUES: KT-30756, KT-35668 */ fun case_3(x: Int?) { while (true) { - x ?: return ?: x + x ?: return ?: x } x diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/6.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/6.kt index 8e522c28619..0691f5220ce 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/6.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/6.kt @@ -328,22 +328,26 @@ val case_17 = if (nullableIntProperty === implicitNullabl nullableIntProperty.funNullableAny() } -//TESTCASE NUMBER: 18 +/* + * TESTCASE NUMBER: 18 + * UNEXPECTED BEHAVIOUR + * ISSUES: KT-35668, KT-35668 + */ fun case_18(a: DeepObject.A.B.C.D.E.F.G.J?, b: Boolean) { val x = null val y = null - if (a != (if (b) x else y) || x !== a) { - a - a.equals(null) - a.propT - a.propAny - a.propNullableT - a.propNullableAny - a.funT() - a.funAny() - a.funNullableT() - a.funNullableAny() + if (a != (if (b) x else y) || x !== a) { + a + a.equals(null) + a.propT + a.propAny + a.propNullableT + a.propNullableAny + a.funT() + a.funAny() + a.funNullableT() + a.funNullableAny() } } @@ -1172,23 +1176,27 @@ fun case_65(x: Any?, z: Nothing?) { } } -// TESTCASE NUMBER: 66 +/* + * TESTCASE NUMBER: 66 + * UNEXPECTED BEHAVIOUR + * ISSUES: KT-35668 + */ fun case_66(x: Any?, z1: Nothing?, z2: Nothing?, b: Boolean) { if (x is ClassLevel1?) { if (x is ClassLevel2?) { if (x is ClassLevel3?) { if (x != if (b) { z1 } else { z2 } && x is ClassLevel4?) { if (x is ClassLevel5?) { - x - x.equals(null) - x.propT - x.propAny - x.propNullableT - x.propNullableAny - x.funT() - x.funAny() - x.funNullableT() - x.funNullableAny() + x + x.equals(null) + x.propT + x.propAny + x.propNullableT + x.propNullableAny + x.funT() + x.funAny() + x.funNullableT() + x.funNullableAny() } } } @@ -1234,19 +1242,23 @@ fun case_68(x: Any?, z: Nothing?) { } } -// TESTCASE NUMBER: 69 +/* + * TESTCASE NUMBER: 69 + * UNEXPECTED BEHAVIOUR + * ISSUES: KT-35668 + */ fun case_69(x: Any?, z: Nothing?) { if (x is ClassLevel1? && x is ClassLevel2? && x is ClassLevel3? && x is ClassLevel4? && x != try { z } catch (e: Exception) { z } && x is ClassLevel5?) { - x - x.equals(null) - x.propT - x.propAny - x.propNullableT - x.propNullableAny - x.funT() - x.funAny() - x.funNullableT() - x.funNullableAny() + x + x.equals(null) + x.propT + x.propAny + x.propNullableT + x.propNullableAny + x.funT() + x.funAny() + x.funNullableT() + x.funNullableAny() } } @@ -1309,18 +1321,19 @@ fun case_71(t: Any?) { * TESTCASE NUMBER: 72 * NOTE: lazy smartcasts * DISCUSSION - * ISSUES: KT-28362, KT-27032 + * UNEXPECTED BEHAVIOUR + * ISSUES: KT-28362, KT-27032, KT-35668 */ fun case_72(t: Any?, z1: Nothing?) { var z2 = null if (t is Interface1? && t != z1 ?: z2 && t is Interface2?) { - t - t.itest1() - t.itest2() - t.itest() + t + t.itest1() + t.itest2() + t.itest() - t.let { it.itest1(); it.itest2() } + t.let { it.itest1(); it.itest2() } } } @@ -1328,6 +1341,7 @@ fun case_72(t: Any?, z1: Nothing?) { * TESTCASE NUMBER: 73 * NOTE: lazy smartcasts * DISCUSSION + * UNEXPECTED BEHAVIOUR * ISSUES: KT-28362 */ fun case_73(t: Any?) {