FIR checker: SENSELESS_(COMPARISON|NULL_IN_WHEN)

Currently DFA does not set "definitely equal to null" for access to variables that got assigned `null`. For example, FIR should mark the following line as SENSELESS_COMPARISON due to `s = null` above.
 https://github.com/JetBrains/kotlin/blob/d1531f9cdd5852352c0133198706125dc63b6007/compiler/testData/diagnostics/tests/smartCasts/alwaysNull.fir.kt#L6

The problem is at https://github.com/JetBrains/kotlin/blob/7e9f27436a77de1c76e3705da7aa1fbe8938336b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/dfa/FirDataFlowAnalyzer.kt#L1104

For null assignment, ideally the type should be `Nothing?`. This is
addressed in a followup commit instead.
This commit is contained in:
Tianyu Geng
2021-07-20 09:46:18 -07:00
committed by teamcityserver
parent 4726dcce40
commit c7272f6986
108 changed files with 1410 additions and 1485 deletions
@@ -226,7 +226,7 @@ fun case_23(value_1: Nothing) {
// TESTCASE NUMBER: 24
fun case_24(value_1: Nothing?) = when (value_1) {
throw Exception(), <!RETURN_IN_FUNCTION_WITH_EXPRESSION_BODY!>return<!> "" -> ""
null, <!RETURN_IN_FUNCTION_WITH_EXPRESSION_BODY!>return<!> <!RETURN_IN_FUNCTION_WITH_EXPRESSION_BODY!>return<!> <!RETURN_IN_FUNCTION_WITH_EXPRESSION_BODY!>return<!> "", throw throw throw Exception() -> ""
<!SENSELESS_NULL_IN_WHEN!>null<!>, <!RETURN_IN_FUNCTION_WITH_EXPRESSION_BODY!>return<!> <!RETURN_IN_FUNCTION_WITH_EXPRESSION_BODY!>return<!> <!RETURN_IN_FUNCTION_WITH_EXPRESSION_BODY!>return<!> "", throw throw throw Exception() -> ""
else -> ""
}
@@ -157,29 +157,29 @@ fun <T> T?.case_22_3(): Boolean? {
// TESTCASE NUMBER: 23
fun <T : Number?> T.case_23_1(): Boolean {
contract { returns(false) implies (this@case_23_1 !is Int || this@case_23_1 == null) }
return !(this@case_23_1 !is Int || this@case_23_1 == null)
return !(this@case_23_1 !is Int || <!SENSELESS_COMPARISON!>this@case_23_1 == null<!>)
}
fun <T : Number?> T.case_23_2(): Boolean? {
contract { returnsNotNull() implies (this@case_23_2 !is Int || this@case_23_2 == null) }
return if (this@case_23_2 !is Int || this@case_23_2 == null) true else null
return if (this@case_23_2 !is Int || <!SENSELESS_COMPARISON!>this@case_23_2 == null<!>) true else null
}
fun <T : Number?> T.case_23_3(): Boolean? {
contract { returns(null) implies (this@case_23_3 !is Int || this@case_23_3 == null) }
return if (this@case_23_3 !is Int || this@case_23_3 == null) null else true
return if (this@case_23_3 !is Int || <!SENSELESS_COMPARISON!>this@case_23_3 == null<!>) null else true
}
// TESTCASE NUMBER: 24
inline fun <reified T : Any?> T?.case_24_1(): Boolean {
contract { returns(false) implies (this@case_24_1 !is Number || this@case_24_1 !is Int || this@case_24_1 == null) }
return !(this@case_24_1 !is Number || this@case_24_1 !is Int || this@case_24_1 == null)
return !(this@case_24_1 !is Number || this@case_24_1 !is Int || <!SENSELESS_COMPARISON!>this@case_24_1 == null<!>)
}
inline fun <reified T : Any?> T?.case_24_2(): Boolean? {
contract { returnsNotNull() implies (this@case_24_2 !is Number || this@case_24_2 !is Int || this@case_24_2 == null) }
return if (this@case_24_2 !is Number || this@case_24_2 !is Int || this@case_24_2 == null) true else null
return if (this@case_24_2 !is Number || this@case_24_2 !is Int || <!SENSELESS_COMPARISON!>this@case_24_2 == null<!>) true else null
}
inline fun <reified T : Any?> T?.case_24_3(): Boolean? {
contract { returns(null) implies (this@case_24_3 !is Number || this@case_24_3 !is Int || this@case_24_3 == null) }
return if (this@case_24_3 !is Number || this@case_24_3 !is Int || this@case_24_3 == null) null else true
return if (this@case_24_3 !is Number || this@case_24_3 !is Int || <!SENSELESS_COMPARISON!>this@case_24_3 == null<!>) null else true
}
// TESTCASE NUMBER: 25
@@ -15,13 +15,13 @@ fun <T> T?.case_1() {
// TESTCASE NUMBER: 2
fun <T : Number?> T.case_2() {
contract { returns() implies (this@case_2 !is Int || this@case_2 == null) }
if (!(this@case_2 !is Int || this@case_2 == null)) throw Exception()
if (!(this@case_2 !is Int || <!SENSELESS_COMPARISON!>this@case_2 == null<!>)) throw Exception()
}
// TESTCASE NUMBER: 3
inline fun <reified T : Any?> T?.case_3() {
contract { returns() implies (this@case_3 !is Number || this@case_3 !is Int || this@case_3 == null) }
if (!(this@case_3 !is Number || this@case_3 !is Int || this@case_3 == null)) throw Exception()
if (!(this@case_3 !is Number || this@case_3 !is Int || <!SENSELESS_COMPARISON!>this@case_3 == null<!>)) throw Exception()
}
// TESTCASE NUMBER: 4
@@ -45,37 +45,37 @@ fun <T> T?.case_4_4(): Boolean? {
// TESTCASE NUMBER: 5
fun <T : Number?> T.case_5_1(): Boolean {
contract { returns(true) implies (this@case_5_1 !is Int || this@case_5_1 == null) }
return this@case_5_1 !is Int || this@case_5_1 == null
return this@case_5_1 !is Int || <!SENSELESS_COMPARISON!>this@case_5_1 == null<!>
}
fun <T : Number?> T.case_5_2(): Boolean {
contract { returns(false) implies (this@case_5_2 !is Int || this@case_5_2 == null) }
return !(this@case_5_2 !is Int || this@case_5_2 == null)
return !(this@case_5_2 !is Int || <!SENSELESS_COMPARISON!>this@case_5_2 == null<!>)
}
fun <T : Number?> T.case_5_3(): Boolean? {
contract { returnsNotNull() implies (this@case_5_3 !is Int || this@case_5_3 == null) }
return if (this@case_5_3 !is Int || this@case_5_3 == null) true else null
return if (this@case_5_3 !is Int || <!SENSELESS_COMPARISON!>this@case_5_3 == null<!>) true else null
}
fun <T : Number?> T.case_5_4(): Boolean? {
contract { returns(null) implies (this@case_5_4 !is Int || this@case_5_4 == null) }
return if (this@case_5_4 !is Int || this@case_5_4 == null) null else true
return if (this@case_5_4 !is Int || <!SENSELESS_COMPARISON!>this@case_5_4 == null<!>) null else true
}
// TESTCASE NUMBER: 6
inline fun <reified T : Any?> T?.case_6_1(): Boolean {
contract { returns(true) implies (this@case_6_1 !is Number || this@case_6_1 !is Int || this@case_6_1 == null) }
return this@case_6_1 !is Number || this@case_6_1 !is Int || this@case_6_1 == null
return this@case_6_1 !is Number || this@case_6_1 !is Int || <!SENSELESS_COMPARISON!>this@case_6_1 == null<!>
}
inline fun <reified T : Any?> T?.case_6_2(): Boolean {
contract { returns(false) implies (this@case_6_2 !is Number || this@case_6_2 !is Int || this@case_6_2 == null) }
return !(this@case_6_2 !is Number || this@case_6_2 !is Int || this@case_6_2 == null)
return !(this@case_6_2 !is Number || this@case_6_2 !is Int || <!SENSELESS_COMPARISON!>this@case_6_2 == null<!>)
}
inline fun <reified T : Any?> T?.case_6_3(): Boolean? {
contract { returnsNotNull() implies (this@case_6_3 is Number && this@case_6_3 is Int && this@case_6_3 != null) }
return if (this@case_6_3 is Number && this@case_6_3 is Int && this@case_6_3 != null) true else null
return if (this@case_6_3 is Number && this@case_6_3 is Int && <!SENSELESS_COMPARISON!>this@case_6_3 != null<!>) true else null
}
inline fun <reified T : Any?> T?.case_6_4(): Boolean? {
contract { returns(null) implies (this@case_6_4 is Number && this@case_6_4 is Int && this@case_6_4 != null) }
return if (this@case_6_4 is Number && this@case_6_4 is Int && this@case_6_4 != null) null else true
return if (this@case_6_4 is Number && this@case_6_4 is Int && <!SENSELESS_COMPARISON!>this@case_6_4 != null<!>) null else true
}
// FILE: main.kt
@@ -15,13 +15,13 @@ fun <T> T?.case_1(value_1: Int?) {
// TESTCASE NUMBER: 2
fun <T : Number?> T.case_2(value_2: Any?) {
contract { returns() implies (this@case_2 !is Int || this@case_2 == null || value_2 !is Number || value_2 == null) }
if (!(this@case_2 !is Int || this@case_2 == null || value_2 !is Number || value_2 == null)) throw Exception()
if (!(this@case_2 !is Int || <!SENSELESS_COMPARISON!>this@case_2 == null<!> || value_2 !is Number || <!SENSELESS_COMPARISON!>value_2 == null<!>)) throw Exception()
}
// TESTCASE NUMBER: 3
fun <T : Any?> T?.case_3(value_2: Any?) {
contract { returns() implies (this@case_3 !is Number || this@case_3 !is Int || this@case_3 == null || value_2 == null) }
if (!(this@case_3 !is Number || this@case_3 !is Int || this@case_3 == null || value_2 == null)) throw Exception()
if (!(this@case_3 !is Number || this@case_3 !is Int || <!SENSELESS_COMPARISON!>this@case_3 == null<!> || value_2 == null)) throw Exception()
}
// TESTCASE NUMBER: 4
@@ -51,37 +51,37 @@ fun <T> T?.case_5_4(value_1: Int?): Boolean? {
// TESTCASE NUMBER: 6
fun <T : Number?> T.case_6_1(value_2: Any?): Boolean {
contract { returns(true) implies (this@case_6_1 !is Int || this@case_6_1 == null || value_2 !is Number || value_2 == null) }
return this@case_6_1 !is Int || this@case_6_1 == null || value_2 !is Number || value_2 == null
return this@case_6_1 !is Int || <!SENSELESS_COMPARISON!>this@case_6_1 == null<!> || value_2 !is Number || <!SENSELESS_COMPARISON!>value_2 == null<!>
}
fun <T : Number?> T.case_6_2(value_2: Any?): Boolean {
contract { returns(false) implies (this@case_6_2 !is Int || this@case_6_2 == null || value_2 !is Number || value_2 == null) }
return !(this@case_6_2 !is Int || this@case_6_2 == null || value_2 !is Number || value_2 == null)
return !(this@case_6_2 !is Int || <!SENSELESS_COMPARISON!>this@case_6_2 == null<!> || value_2 !is Number || <!SENSELESS_COMPARISON!>value_2 == null<!>)
}
fun <T : Number?> T.case_6_3(value_2: Any?): Boolean? {
contract { returnsNotNull() implies (this@case_6_3 !is Int || this@case_6_3 == null || value_2 !is Number || value_2 == null) }
return if (this@case_6_3 !is Int || this@case_6_3 == null || value_2 !is Number || value_2 == null) true else null
return if (this@case_6_3 !is Int || <!SENSELESS_COMPARISON!>this@case_6_3 == null<!> || value_2 !is Number || <!SENSELESS_COMPARISON!>value_2 == null<!>) true else null
}
fun <T : Number?> T.case_6_4(value_2: Any?): Boolean? {
contract { returns(null) implies (this@case_6_4 !is Int || this@case_6_4 == null || value_2 !is Number || value_2 == null) }
return if (this@case_6_4 !is Int || this@case_6_4 == null || value_2 !is Number || value_2 == null) null else true
return if (this@case_6_4 !is Int || <!SENSELESS_COMPARISON!>this@case_6_4 == null<!> || value_2 !is Number || <!SENSELESS_COMPARISON!>value_2 == null<!>) null else true
}
// TESTCASE NUMBER: 7
fun <T : Any?> T?.case_7_1(value_2: Any?): Boolean {
contract { returns(true) implies (this@case_7_1 !is Number || this@case_7_1 !is Int || this@case_7_1 == null || value_2 == null) }
return this@case_7_1 !is Number || this@case_7_1 !is Int || this@case_7_1 == null || value_2 == null
return this@case_7_1 !is Number || this@case_7_1 !is Int || <!SENSELESS_COMPARISON!>this@case_7_1 == null<!> || value_2 == null
}
fun <T : Any?> T?.case_7_2(value_2: Any?): Boolean {
contract { returns(false) implies (this@case_7_2 !is Number || this@case_7_2 !is Int || this@case_7_2 == null || value_2 == null) }
return !(this@case_7_2 !is Number || this@case_7_2 !is Int || this@case_7_2 == null || value_2 == null)
return !(this@case_7_2 !is Number || this@case_7_2 !is Int || <!SENSELESS_COMPARISON!>this@case_7_2 == null<!> || value_2 == null)
}
fun <T : Any?> T?.case_7_3(value_2: Any?): Boolean? {
contract { returnsNotNull() implies (this@case_7_3 !is Number || this@case_7_3 !is Int || this@case_7_3 == null || value_2 == null) }
return if (this@case_7_3 !is Number || this@case_7_3 !is Int || this@case_7_3 == null || value_2 == null) true else null
return if (this@case_7_3 !is Number || this@case_7_3 !is Int || <!SENSELESS_COMPARISON!>this@case_7_3 == null<!> || value_2 == null) true else null
}
fun <T : Any?> T?.case_7_4(value_2: Any?): Boolean? {
contract { returns(null) implies (this@case_7_4 !is Number || this@case_7_4 !is Int || this@case_7_4 == null || value_2 == null) }
return if (this@case_7_4 !is Number || this@case_7_4 !is Int || this@case_7_4 == null || value_2 == null) null else true
return if (this@case_7_4 !is Number || this@case_7_4 !is Int || <!SENSELESS_COMPARISON!>this@case_7_4 == null<!> || value_2 == null) null else true
}
// TESTCASE NUMBER: 8
@@ -25,7 +25,7 @@ fun case_4(value_1: Number, block: (() -> Unit)?): Boolean? {
returns(null) implies (block == null)
}<!>
return value_1 == null
return <!SENSELESS_COMPARISON!>value_1 == null<!>
}
// TESTCASE NUMBER: 5
@@ -48,7 +48,7 @@ fun <T> T?.case_6(value_1: Number, value_2: String?): Boolean? {
returnsNotNull() implies (value_2 == null)
}<!>
return value_1 == null
return <!SENSELESS_COMPARISON!>value_1 == null<!>
}
// FILE: main.kt
@@ -69,7 +69,7 @@ fun case_3(value_1: Int?) {
// TESTCASE NUMBER: 4
fun case_4(value_1: Any?) {
if (contracts.case_4(value_1) != null) {
if (<!SENSELESS_COMPARISON!>contracts.case_4(value_1) != null<!>) {
value_1.toByte()
}
}
@@ -15,13 +15,13 @@ fun <T> T?.case_1() {
// TESTCASE NUMBER: 2
fun <T : Number?> T.case_2() {
contract { returns() implies (this@case_2 is Int && this@case_2 != null) }
if (!(this@case_2 is Int && this@case_2 != null)) throw Exception()
if (!(this@case_2 is Int && <!SENSELESS_COMPARISON!>this@case_2 != null<!>)) throw Exception()
}
// TESTCASE NUMBER: 3
inline fun <reified T : Any?> T?.case_3() {
contract { returns() implies (this@case_3 is Number && this@case_3 is Int && this@case_3 != null) }
if (!(this@case_3 is Number && this@case_3 is Int && this@case_3 != null)) throw Exception()
if (!(this@case_3 is Number && this@case_3 is Int && <!SENSELESS_COMPARISON!>this@case_3 != null<!>)) throw Exception()
}
// TESTCASE NUMBER: 4
@@ -45,37 +45,37 @@ fun <T> T?.case_4_4(): Boolean? {
// TESTCASE NUMBER: 5
fun <T : Number?> T.case_5_1(): Boolean {
contract { returns(true) implies (this@case_5_1 is Int && this@case_5_1 != null) }
return this@case_5_1 is Int && this@case_5_1 != null
return this@case_5_1 is Int && <!SENSELESS_COMPARISON!>this@case_5_1 != null<!>
}
fun <T : Number?> T.case_5_2(): Boolean {
contract { returns(false) implies (this@case_5_2 is Int && this@case_5_2 != null) }
return !(this@case_5_2 is Int && this@case_5_2 != null)
return !(this@case_5_2 is Int && <!SENSELESS_COMPARISON!>this@case_5_2 != null<!>)
}
fun <T : Number?> T.case_5_3(): Boolean? {
contract { returnsNotNull() implies (this@case_5_3 is Int && this@case_5_3 != null) }
return if (this@case_5_3 is Int && this@case_5_3 != null) true else null
return if (this@case_5_3 is Int && <!SENSELESS_COMPARISON!>this@case_5_3 != null<!>) true else null
}
fun <T : Number?> T.case_5_4(): Boolean? {
contract { returns(null) implies (this@case_5_4 is Int && this@case_5_4 != null) }
return if (this@case_5_4 is Int && this@case_5_4 != null) null else true
return if (this@case_5_4 is Int && <!SENSELESS_COMPARISON!>this@case_5_4 != null<!>) null else true
}
// TESTCASE NUMBER: 6
inline fun <reified T : Any?> T?.case_6_1(): Boolean {
contract { returns(true) implies (this@case_6_1 is Number && this@case_6_1 is Int && this@case_6_1 != null) }
return this@case_6_1 is Number && this@case_6_1 is Int && this@case_6_1 != null
return this@case_6_1 is Number && this@case_6_1 is Int && <!SENSELESS_COMPARISON!>this@case_6_1 != null<!>
}
inline fun <reified T : Any?> T?.case_6_2(): Boolean {
contract { returns(false) implies (this@case_6_2 is Number && this@case_6_2 is Int && this@case_6_2 != null) }
return !(this@case_6_2 is Number && this@case_6_2 is Int && this@case_6_2 != null)
return !(this@case_6_2 is Number && this@case_6_2 is Int && <!SENSELESS_COMPARISON!>this@case_6_2 != null<!>)
}
inline fun <reified T : Any?> T?.case_6_3(): Boolean? {
contract { returnsNotNull() implies (this@case_6_3 is Number && this@case_6_3 is Int && this@case_6_3 != null) }
return if (this@case_6_3 is Number && this@case_6_3 is Int && this@case_6_3 != null) true else null
return if (this@case_6_3 is Number && this@case_6_3 is Int && <!SENSELESS_COMPARISON!>this@case_6_3 != null<!>) true else null
}
inline fun <reified T : Any?> T?.case_6_4(): Boolean? {
contract { returns(null) implies (this@case_6_4 is Number && this@case_6_4 is Int && this@case_6_4 != null) }
return if (this@case_6_4 is Number && this@case_6_4 is Int && this@case_6_4 != null) null else true
return if (this@case_6_4 is Number && this@case_6_4 is Int && <!SENSELESS_COMPARISON!>this@case_6_4 != null<!>) null else true
}
// FILE: main.kt
@@ -15,13 +15,13 @@ fun <T> T?.case_1(value_1: Int?) {
// TESTCASE NUMBER: 2
fun <T : Number?> T.case_2(value_2: Any?) {
contract { returns() implies (this@case_2 is Int && this@case_2 != null && value_2 is Number && value_2 != null) }
if (!(this@case_2 is Int && this@case_2 != null && value_2 is Number && value_2 != null)) throw Exception()
if (!(this@case_2 is Int && <!SENSELESS_COMPARISON!>this@case_2 != null<!> && value_2 is Number && <!SENSELESS_COMPARISON!>value_2 != null<!>)) throw Exception()
}
// TESTCASE NUMBER: 3
fun <T : Any?> T?.case_3(value_2: Any?) {
contract { returns() implies (this@case_3 is Number && this@case_3 is Int && this@case_3 != null && value_2 != null) }
if (!(this@case_3 is Number && this@case_3 is Int && this@case_3 != null && value_2 != null)) throw Exception()
if (!(this@case_3 is Number && this@case_3 is Int && <!SENSELESS_COMPARISON!>this@case_3 != null<!> && value_2 != null)) throw Exception()
}
// TESTCASE NUMBER: 4
@@ -51,37 +51,37 @@ fun <T> T?.case_5_4(value_1: Int?): Boolean? {
// TESTCASE NUMBER: 6
fun <T : Number?> T.case_6_1(value_2: Any?): Boolean {
contract { returns(true) implies (this@case_6_1 is Int && this@case_6_1 != null && value_2 is Number && value_2 != null) }
return this@case_6_1 is Int && this@case_6_1 != null && value_2 is Number && value_2 != null
return this@case_6_1 is Int && <!SENSELESS_COMPARISON!>this@case_6_1 != null<!> && value_2 is Number && <!SENSELESS_COMPARISON!>value_2 != null<!>
}
fun <T : Number?> T.case_6_2(value_2: Any?): Boolean {
contract { returns(false) implies (this@case_6_2 is Int && this@case_6_2 != null && value_2 is Number && value_2 != null) }
return !(this@case_6_2 is Int && this@case_6_2 != null && value_2 is Number && value_2 != null)
return !(this@case_6_2 is Int && <!SENSELESS_COMPARISON!>this@case_6_2 != null<!> && value_2 is Number && <!SENSELESS_COMPARISON!>value_2 != null<!>)
}
fun <T : Number?> T.case_6_3(value_2: Any?): Boolean? {
contract { returnsNotNull() implies (this@case_6_3 is Int && this@case_6_3 != null && value_2 is Number && value_2 != null) }
return if (this@case_6_3 is Int && this@case_6_3 != null && value_2 is Number && value_2 != null) true else null
return if (this@case_6_3 is Int && <!SENSELESS_COMPARISON!>this@case_6_3 != null<!> && value_2 is Number && <!SENSELESS_COMPARISON!>value_2 != null<!>) true else null
}
fun <T : Number?> T.case_6_4(value_2: Any?): Boolean? {
contract { returns(null) implies (this@case_6_4 is Int && this@case_6_4 != null && value_2 is Number && value_2 != null) }
return if (this@case_6_4 is Int && this@case_6_4 != null && value_2 is Number && value_2 != null) null else true
return if (this@case_6_4 is Int && <!SENSELESS_COMPARISON!>this@case_6_4 != null<!> && value_2 is Number && <!SENSELESS_COMPARISON!>value_2 != null<!>) null else true
}
// TESTCASE NUMBER: 7
fun <T : Any?> T?.case_7_1(value_2: Any?): Boolean {
contract { returns(true) implies (this@case_7_1 is Number && this@case_7_1 is Int && this@case_7_1 != null && value_2 != null) }
return this@case_7_1 is Number && this@case_7_1 is Int && this@case_7_1 != null && value_2 != null
return this@case_7_1 is Number && this@case_7_1 is Int && <!SENSELESS_COMPARISON!>this@case_7_1 != null<!> && value_2 != null
}
fun <T : Any?> T?.case_7_2(value_2: Any?): Boolean {
contract { returns(true) implies (this@case_7_2 is Number && this@case_7_2 is Int && this@case_7_2 != null && value_2 != null) }
return this@case_7_2 is Number && this@case_7_2 is Int && this@case_7_2 != null && value_2 != null
return this@case_7_2 is Number && this@case_7_2 is Int && <!SENSELESS_COMPARISON!>this@case_7_2 != null<!> && value_2 != null
}
fun <T : Any?> T?.case_7_3(value_2: Any?): Boolean? {
contract { returnsNotNull() implies (this@case_7_3 is Number && this@case_7_3 is Int && this@case_7_3 != null && value_2 != null) }
return if (this@case_7_3 is Number && this@case_7_3 is Int && this@case_7_3 != null && value_2 != null) true else null
return if (this@case_7_3 is Number && this@case_7_3 is Int && <!SENSELESS_COMPARISON!>this@case_7_3 != null<!> && value_2 != null) true else null
}
fun <T : Any?> T?.case_7_4(value_2: Any?): Boolean? {
contract { returns(null) implies (this@case_7_4 is Number && this@case_7_4 is Int && this@case_7_4 != null && value_2 != null) }
return if (this@case_7_4 is Number && this@case_7_4 is Int && this@case_7_4 != null && value_2 != null) null else true
return if (this@case_7_4 is Number && this@case_7_4 is Int && <!SENSELESS_COMPARISON!>this@case_7_4 != null<!> && value_2 != null) null else true
}
// TESTCASE NUMBER: 8
@@ -26,7 +26,7 @@ fun case_4(value_1: Number, block: (() -> Unit)?): Boolean? {
returns(null) implies (block != null)
}
return value_1 == null
return <!SENSELESS_COMPARISON!>value_1 == null<!>
}
// TESTCASE NUMBER: 5
@@ -49,7 +49,7 @@ fun <T> T?.case_6(value_1: Number, value_2: String?): Boolean? {
returnsNotNull() implies (value_2 != null)
}<!>
return value_1 == null
return <!SENSELESS_COMPARISON!>value_1 == null<!>
}
// FILE: main.kt
@@ -23,8 +23,8 @@ fun case_3(value_1: String?, value_2: Boolean): Boolean {
// TESTCASE NUMBER: 4
fun case_4(value_1: Nothing?, value_2: Boolean?): Boolean? {
contract { <!ERROR_IN_CONTRACT_DESCRIPTION!>returns(null) implies (value_1 == null || value_2 != null || value_2 == false)<!> }
return if (value_1 == null || value_2 != null || value_2 == false) null else true
contract { <!ERROR_IN_CONTRACT_DESCRIPTION!>returns(null) implies (<!SENSELESS_COMPARISON!>value_1 == null<!> || value_2 != null || value_2 == false)<!> }
return if (<!SENSELESS_COMPARISON!>value_1 == null<!> || value_2 != null || value_2 == false) null else true
}
// TESTCASE NUMBER: 5
@@ -5,7 +5,7 @@ import kotlin.contracts.*
// TESTCASE NUMBER: 1
fun Any?.case_1(): Boolean {
contract {
<!ERROR_IN_CONTRACT_DESCRIPTION!>returns(true) implies (this != null)<!>
<!ERROR_IN_CONTRACT_DESCRIPTION!>returns(true) implies (<!SENSELESS_COMPARISON!>this != null<!>)<!>
}
return this != null
}
@@ -21,7 +21,7 @@ fun Any?.case_2(): Boolean {
// TESTCASE NUMBER: 3
fun <T> T?.case_3(): Boolean {
contract {
<!ERROR_IN_CONTRACT_DESCRIPTION!>returnsNotNull() implies (this != null)<!>
<!ERROR_IN_CONTRACT_DESCRIPTION!>returnsNotNull() implies (<!SENSELESS_COMPARISON!>this != null<!>)<!>
}
return this != null
}
@@ -66,7 +66,7 @@ fun case_11(value_1: Any?): Boolean? {
// TESTCASE NUMBER: 12
fun Char.case_12() {
contract { returns() implies (this@case_12 == null) }
if (this@case_12 != null) throw Exception()
if (<!SENSELESS_COMPARISON!>this@case_12 != null<!>) throw Exception()
}
// TESTCASE NUMBER: 13
@@ -61,12 +61,12 @@ class case_5<T> : ClassLevel5() {
inner class case_5_1 {
fun <K : Number?>K.case_5_1_1() {
contract { <!ERROR_IN_CONTRACT_DESCRIPTION!>returns() implies (<!UNRESOLVED_LABEL!>this@case_5_1<!> !is ClassLevel1 && <!UNRESOLVED_LABEL!>this@case_5_1<!> != null || <!UNRESOLVED_LABEL!>this@case_5<!> is ClassLevel1 && this@case_5_1_1 is Float)<!> }
if (!(this@case_5_1 !is ClassLevel1 && this@case_5_1 != null || <!USELESS_IS_CHECK!>this@case_5 is ClassLevel1<!> && this is Float)) throw Exception()
if (!(this@case_5_1 !is ClassLevel1 && <!SENSELESS_COMPARISON!>this@case_5_1 != null<!> || <!USELESS_IS_CHECK!>this@case_5 is ClassLevel1<!> && this is Float)) throw Exception()
}
fun case_5_1_2() {
contract { <!ERROR_IN_CONTRACT_DESCRIPTION!>returns() implies (<!UNRESOLVED_LABEL!>this@case_5_1<!> !is ClassLevel1 || <!UNRESOLVED_LABEL!>this@case_5<!> is ClassLevel1 || <!UNRESOLVED_LABEL!>this@case_5_1<!> == null)<!> }
if (!(this@case_5_1 !is ClassLevel1 || <!USELESS_IS_CHECK!>this@case_5 is ClassLevel1<!> || this@case_5_1 == null)) throw Exception()
if (!(this@case_5_1 !is ClassLevel1 || <!USELESS_IS_CHECK!>this@case_5 is ClassLevel1<!> || <!SENSELESS_COMPARISON!>this@case_5_1 == null<!>)) throw Exception()
}
}
}
@@ -20,7 +20,7 @@ fun case_1(x: Any?) {
// TESTCASE NUMBER: 3
fun case_3() {
if (Object.prop_1 == null !== null)
if (<!SENSELESS_COMPARISON!>Object.prop_1 == null !== null<!>)
else {
Object.prop_1
Object.prop_1<!UNSAFE_CALL!>.<!>equals(null)
@@ -56,15 +56,15 @@ fun case_5() {
val x: Unit? = null
if (<!EQUALITY_NOT_APPLICABLE!>x !== <!USELESS_IS_CHECK!>null is Boolean?<!><!>) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Unit?")!>x<!>
if (x !== null == null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Unit?")!>x<!><!UNSAFE_CALL!>.<!>equals(null)
if (x !== null == null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Unit?")!>x<!>.propT
if (x !== null == null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Unit?")!>x<!><!UNSAFE_CALL!>.<!>propAny
if (x !== null == null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Unit?")!>x<!>.propNullableT
if (x !== null == null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Unit?")!>x<!>.propNullableAny
if (x !== null == null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Unit?")!>x<!>.funT()
if (x !== null == null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Unit?")!>x<!><!UNSAFE_CALL!>.<!>funAny()
if (x !== null == null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Unit?")!>x<!>.funNullableT()
if (x !== null == null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Unit?")!>x<!>.funNullableAny()
if (<!SENSELESS_COMPARISON!>x !== null == null<!>) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Unit?")!>x<!><!UNSAFE_CALL!>.<!>equals(null)
if (<!SENSELESS_COMPARISON!>x !== null == null<!>) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Unit?")!>x<!>.propT
if (<!SENSELESS_COMPARISON!>x !== null == null<!>) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Unit?")!>x<!><!UNSAFE_CALL!>.<!>propAny
if (<!SENSELESS_COMPARISON!>x !== null == null<!>) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Unit?")!>x<!>.propNullableT
if (<!SENSELESS_COMPARISON!>x !== null == null<!>) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Unit?")!>x<!>.propNullableAny
if (<!SENSELESS_COMPARISON!>x !== null == null<!>) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Unit?")!>x<!>.funT()
if (<!SENSELESS_COMPARISON!>x !== null == null<!>) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Unit?")!>x<!><!UNSAFE_CALL!>.<!>funAny()
if (<!SENSELESS_COMPARISON!>x !== null == null<!>) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Unit?")!>x<!>.funNullableT()
if (<!SENSELESS_COMPARISON!>x !== null == null<!>) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Unit?")!>x<!>.funNullableAny()
}
// TESTCASE NUMBER: 6
@@ -103,13 +103,13 @@ fun case_7() {
// TESTCASE NUMBER: 8
fun case_8(x: TypealiasNullableString) {
if (x !== null === null && <!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableString")!>x<!> != null != null) <!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableString")!>x<!><!UNSAFE_CALL!>.<!>get(0)
if (x !== null != null && <!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableString")!>x<!> != null === null) <!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableString")!>x<!><!UNSAFE_CALL!>.<!>get(0)
if (<!SENSELESS_COMPARISON!><!SENSELESS_COMPARISON!>x !== null<!> === null<!> && <!SENSELESS_COMPARISON!><!SENSELESS_COMPARISON!><!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableString")!>x<!> != null<!> != null<!>) <!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableString")!>x<!><!UNSAFE_CALL!>.<!>get(0)
if (<!SENSELESS_COMPARISON!><!SENSELESS_COMPARISON!>x !== null<!> != null<!> && <!SENSELESS_COMPARISON!><!SENSELESS_COMPARISON!><!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableString")!>x<!> != null<!> === null<!>) <!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableString")!>x<!><!UNSAFE_CALL!>.<!>get(0)
}
// TESTCASE NUMBER: 9
fun case_9(x: TypealiasNullableString?) {
if (x === null === null) {
if (<!SENSELESS_COMPARISON!>x === null === null<!>) {
} else if (<!USELESS_IS_CHECK!>false is Boolean<!>) {
<!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableString?")!>x<!>
@@ -122,7 +122,7 @@ fun case_10() {
val a = Class()
if (a.prop_4 === null || <!USELESS_IS_CHECK!>true is Boolean<!>) {
if (a.prop_4 != null !== null) {
if (<!SENSELESS_COMPARISON!>a.prop_4 != null !== null<!>) {
a.prop_4
a.prop_4<!UNSAFE_CALL!>.<!>equals(null)
a.prop_4.propT
@@ -165,17 +165,17 @@ fun case_11(x: TypealiasNullableStringIndirect?, y: TypealiasNullableStringIndir
// TESTCASE NUMBER: 12
fun case_12(x: TypealiasNullableStringIndirect, y: TypealiasNullableStringIndirect) =
if (<!USELESS_IS_CHECK!>(x == null) !is Boolean<!> === false) "1"
else if (<!USELESS_IS_CHECK!>(y === null !== null) is Boolean<!>) <!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableStringIndirect")!>x<!>
else if (y === null != null) <!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableStringIndirect")!>x<!>.equals(null)
else if (y === null != null) <!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableStringIndirect")!>x<!>.propT
else if (y === null != null) <!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableStringIndirect")!>x<!><!UNSAFE_CALL!>.<!>propAny
else if (y === null != null) <!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableStringIndirect")!>x<!>.propNullableT
else if (y === null != null) <!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableStringIndirect")!>x<!>.propNullableAny
else if (y === null != null) <!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableStringIndirect")!>x<!>.funT()
else if (y === null != null) <!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableStringIndirect")!>x<!><!UNSAFE_CALL!>.<!>funAny()
else if (y === null != null) <!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableStringIndirect")!>x<!>.funNullableT()
else if (y === null != null) <!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableStringIndirect")!>x<!>.funNullableAny()
if (<!USELESS_IS_CHECK!>(<!SENSELESS_COMPARISON!>x == null<!>) !is Boolean<!> === false) "1"
else if (<!USELESS_IS_CHECK!>(<!SENSELESS_COMPARISON!><!SENSELESS_COMPARISON!>y === null<!> !== null<!>) is Boolean<!>) <!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableStringIndirect")!>x<!>
else if (<!SENSELESS_COMPARISON!><!SENSELESS_COMPARISON!>y === null<!> != null<!>) <!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableStringIndirect")!>x<!>.equals(null)
else if (<!SENSELESS_COMPARISON!><!SENSELESS_COMPARISON!>y === null<!> != null<!>) <!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableStringIndirect")!>x<!>.propT
else if (<!SENSELESS_COMPARISON!><!SENSELESS_COMPARISON!>y === null<!> != null<!>) <!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableStringIndirect")!>x<!><!UNSAFE_CALL!>.<!>propAny
else if (<!SENSELESS_COMPARISON!><!SENSELESS_COMPARISON!>y === null<!> != null<!>) <!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableStringIndirect")!>x<!>.propNullableT
else if (<!SENSELESS_COMPARISON!><!SENSELESS_COMPARISON!>y === null<!> != null<!>) <!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableStringIndirect")!>x<!>.propNullableAny
else if (<!SENSELESS_COMPARISON!><!SENSELESS_COMPARISON!>y === null<!> != null<!>) <!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableStringIndirect")!>x<!>.funT()
else if (<!SENSELESS_COMPARISON!><!SENSELESS_COMPARISON!>y === null<!> != null<!>) <!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableStringIndirect")!>x<!><!UNSAFE_CALL!>.<!>funAny()
else if (<!SENSELESS_COMPARISON!><!SENSELESS_COMPARISON!>y === null<!> != null<!>) <!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableStringIndirect")!>x<!>.funNullableT()
else if (<!SENSELESS_COMPARISON!><!SENSELESS_COMPARISON!>y === null<!> != null<!>) <!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableStringIndirect")!>x<!>.funNullableAny()
else "-1"
// TESTCASE NUMBER: 13
@@ -200,15 +200,15 @@ fun case_14() {
if (a.x != <!USELESS_IS_CHECK!>null !is Boolean !is Boolean<!>) {
if (a.x != null == true) {
if (a.x !== null == false) {
if (a.x != null == null) {
if (a.x != null !== null) {
if (a.x != null === true) {
if (a.x !== null === <!USELESS_IS_CHECK!>true !is Boolean<!> == true) {
if (a.x != null !== false) {
if (a.x != null === false) {
if (a.x !== null === true) {
if (<!USELESS_IS_CHECK!>(a.x != null != true) !is Boolean<!>) {
if (<!SENSELESS_COMPARISON!>a.x !== null<!> == false) {
if (<!SENSELESS_COMPARISON!><!SENSELESS_COMPARISON!>a.x != null<!> == null<!>) {
if (<!SENSELESS_COMPARISON!><!SENSELESS_COMPARISON!>a.x != null<!> !== null<!>) {
if (<!SENSELESS_COMPARISON!>a.x != null<!> === true) {
if (<!SENSELESS_COMPARISON!>a.x !== null<!> === <!USELESS_IS_CHECK!>true !is Boolean<!> == true) {
if (<!SENSELESS_COMPARISON!>a.x != null<!> !== false) {
if (<!SENSELESS_COMPARISON!>a.x != null<!> === false) {
if (<!SENSELESS_COMPARISON!>a.x !== null<!> === true) {
if (<!USELESS_IS_CHECK!>(<!SENSELESS_COMPARISON!>a.x != null<!> != true) !is Boolean<!>) {
if (a.x != null is Boolean) {
if (a.x != <!USELESS_IS_CHECK!>null is Boolean is Boolean<!>) {
if (a.x !== null is Boolean) {
@@ -268,7 +268,7 @@ val case_17 = if (nullableIntProperty == null == true == false) 0 else {
//TESTCASE NUMBER: 18
fun case_18(a: DeepObject.A.B.C.D.E.F.G.J?) {
if (a != null !== null) {
if (<!SENSELESS_COMPARISON!>a != null !== null<!>) {
<!DEBUG_INFO_EXPRESSION_TYPE("DeepObject.A.B.C.D.E.F.G.J?")!>a<!>
<!DEBUG_INFO_EXPRESSION_TYPE("DeepObject.A.B.C.D.E.F.G.J?")!>a<!><!UNSAFE_CALL!>.<!>equals(null)
<!DEBUG_INFO_EXPRESSION_TYPE("DeepObject.A.B.C.D.E.F.G.J?")!>a<!>.propT
@@ -302,7 +302,7 @@ fun case_19(b: Boolean) {
}
} else null
if (<!EQUALITY_NOT_APPLICABLE!>a != null !is Boolean<!> && <!EQUALITY_NOT_APPLICABLE!>a<!UNSAFE_CALL!>.<!>B19 != null is Boolean<!> && <!EQUALITY_NOT_APPLICABLE!>a<!UNSAFE_CALL!>.<!>B19<!UNSAFE_CALL!>.<!>C19 != null is Boolean<!> && a<!UNSAFE_CALL!>.<!>B19<!UNSAFE_CALL!>.<!>C19<!UNSAFE_CALL!>.<!>D19 != null == null && a<!UNSAFE_CALL!>.<!>B19<!UNSAFE_CALL!>.<!>C19<!UNSAFE_CALL!>.<!>D19<!UNSAFE_CALL!>.<!>x != null !== null) {
if (<!EQUALITY_NOT_APPLICABLE!>a != null !is Boolean<!> && <!EQUALITY_NOT_APPLICABLE!>a<!UNSAFE_CALL!>.<!>B19 != null is Boolean<!> && <!EQUALITY_NOT_APPLICABLE!>a<!UNSAFE_CALL!>.<!>B19<!UNSAFE_CALL!>.<!>C19 != null is Boolean<!> && <!SENSELESS_COMPARISON!>a<!UNSAFE_CALL!>.<!>B19<!UNSAFE_CALL!>.<!>C19<!UNSAFE_CALL!>.<!>D19 != null == null<!> && <!SENSELESS_COMPARISON!>a<!UNSAFE_CALL!>.<!>B19<!UNSAFE_CALL!>.<!>C19<!UNSAFE_CALL!>.<!>D19<!UNSAFE_CALL!>.<!>x != null !== null<!>) {
a<!UNSAFE_CALL!>.<!>B19<!UNSAFE_CALL!>.<!>C19<!UNSAFE_CALL!>.<!>D19<!UNSAFE_CALL!>.<!>x
a<!UNSAFE_CALL!>.<!>B19<!UNSAFE_CALL!>.<!>C19<!UNSAFE_CALL!>.<!>D19<!UNSAFE_CALL!>.<!>x<!UNSAFE_CALL!>.<!>equals(null)
a<!UNSAFE_CALL!>.<!>B19<!UNSAFE_CALL!>.<!>C19<!UNSAFE_CALL!>.<!>D19<!UNSAFE_CALL!>.<!>x.propT
@@ -28,7 +28,7 @@ fun case_3(x: Boolean?) {
// TESTCASE NUMBER: 4
fun case_4(x: Boolean?) {
if (if (x != null) x else x != null) {
if (if (x != null) x else <!SENSELESS_COMPARISON!>x != null<!>) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Boolean?")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Boolean?")!>x<!><!UNSAFE_CALL!>.<!>not()
}
@@ -17,7 +17,7 @@ fun case_1(x: ClassWithCustomEquals) {
// TESTCASE NUMBER: 2
fun case_2(x: ClassWithCustomEquals) {
if (x == null) {
if (<!SENSELESS_COMPARISON!>x == null<!>) {
<!DEBUG_INFO_EXPRESSION_TYPE("ClassWithCustomEquals & kotlin.Nothing")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("ClassWithCustomEquals & kotlin.Nothing")!>x<!>.inv()
}
@@ -75,7 +75,7 @@ fun case_6(x: ClassWithCustomEquals) {
// TESTCASE NUMBER: 7
fun case_7(x: ClassWithCustomEquals) {
if ((x != null) == false) {
if ((<!SENSELESS_COMPARISON!>x != null<!>) == false) {
<!DEBUG_INFO_EXPRESSION_TYPE("ClassWithCustomEquals & kotlin.Nothing")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("ClassWithCustomEquals & kotlin.Nothing")!>x<!>.inv()
}
@@ -32,7 +32,7 @@ class Case2 {
val x: Int
init {
val y = this
if (y.x == null) {
if (<!SENSELESS_COMPARISON!>y.x == null<!>) {
x = 11
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int")!>x<!>
this.x
@@ -144,7 +144,7 @@ fun case_9() {
outer@ while (x != null) {
inner@ do {
x = null
} while (x != null)
} while (<!SENSELESS_COMPARISON!>x != null<!>)
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String? & kotlin.Nothing?")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String? & kotlin.Nothing?")!>x<!><!UNSAFE_CALL!>.<!>length
}
@@ -171,7 +171,7 @@ fun case_11() {
inner@ do {
x = null
break
} while (x == null)
} while (<!SENSELESS_COMPARISON!>x == null<!>)
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String? & kotlin.Nothing?")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String? & kotlin.Nothing?")!>x<!><!UNSAFE_CALL!>.<!>length
}
@@ -36,7 +36,7 @@ inline fun <reified T>case_3(x: Any?) {
// TESTCASE NUMBER: 4
inline fun <reified T : <!FINAL_UPPER_BOUND!>Boolean<!>>case_4(x: Any?) {
if (x is Int is T == null) {
if (<!SENSELESS_COMPARISON!>x is Int is T == null<!>) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>x<!>.<!UNRESOLVED_REFERENCE!>inv<!>()
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>x<!><!UNSAFE_CALL!>.<!>propAny
@@ -46,7 +46,7 @@ inline fun <reified T : <!FINAL_UPPER_BOUND!>Boolean<!>>case_4(x: Any?) {
// TESTCASE NUMBER: 5
fun case_5(x: Any?) {
if (x is Int != null) {
if (<!SENSELESS_COMPARISON!>x is Int != null<!>) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>x<!>.<!UNRESOLVED_REFERENCE!>inv<!>()
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>x<!><!UNSAFE_CALL!>.<!>propAny
@@ -56,7 +56,7 @@ fun case_5(x: Any?) {
// TESTCASE NUMBER: 6
fun case_6(x: Any?) {
if (x is Int == null) {
if (<!SENSELESS_COMPARISON!>x is Int == null<!>) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>x<!>.<!UNRESOLVED_REFERENCE!>inv<!>()
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>x<!><!UNSAFE_CALL!>.<!>propAny
@@ -28,7 +28,7 @@ fun case_3(x: Boolean?) {
// TESTCASE NUMBER: 4
fun case_4(x: Boolean?) {
if (if (x != null) x else x != null) {
if (if (x != null) x else <!SENSELESS_COMPARISON!>x != null<!>) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Boolean?")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Boolean?")!>x<!><!UNSAFE_CALL!>.<!>not()
}
File diff suppressed because it is too large Load Diff
@@ -183,7 +183,7 @@ fun case_6(a: Interface1?, b: Interface2, d: Boolean) {
x.apply {
this as Interface3
<!DEBUG_INFO_EXPRESSION_TYPE("Interface2? & Interface1? & Interface3 & Interface2 & Interface1")!>this<!>
if (this != null) {
if (<!SENSELESS_COMPARISON!>this != null<!>) {
<!DEBUG_INFO_EXPRESSION_TYPE("Interface2? & Interface1? & Interface3 & Interface2 & Interface1")!>this<!>
<!DEBUG_INFO_EXPRESSION_TYPE("Interface2? & Interface1? & Interface3 & Interface2 & Interface1")!>this<!>.equals(null)
<!DEBUG_INFO_EXPRESSION_TYPE("Interface2? & Interface1? & Interface3 & Interface2 & Interface1")!>this<!>.propT
@@ -201,7 +201,7 @@ fun case_6(a: Interface1?, b: Interface2, d: Boolean) {
x.let {
it as Interface3
<!DEBUG_INFO_EXPRESSION_TYPE("Interface2? & Interface1? & Interface3 & Interface2 & Interface1")!>it<!>
if (it != null) {
if (<!SENSELESS_COMPARISON!>it != null<!>) {
<!DEBUG_INFO_EXPRESSION_TYPE("Interface2? & Interface1? & Interface3 & Interface2 & Interface1")!>it<!>
<!DEBUG_INFO_EXPRESSION_TYPE("Interface2? & Interface1? & Interface3 & Interface2 & Interface1")!>it<!>.equals(null)
<!DEBUG_INFO_EXPRESSION_TYPE("Interface2? & Interface1? & Interface3 & Interface2 & Interface1")!>it<!>.propT
@@ -87,7 +87,7 @@ fun <T> T?.case_4() {
// TESTCASE NUMBER: 5
fun <T> T?.case_5() {
if (this is Interface1) {
if (this != null) {
if (<!SENSELESS_COMPARISON!>this != null<!>) {
<!DEBUG_INFO_EXPRESSION_TYPE("T? & Interface1 & T?!!")!>this<!>
<!DEBUG_INFO_EXPRESSION_TYPE("T? & Interface1 & T?!!")!>this<!>.equals(null)
this.propT
@@ -319,7 +319,7 @@ fun <T> T.case_8() {
// TESTCASE NUMBER: 9
fun <T : Number> T.case_9() {
if (this != null) {
if (<!SENSELESS_COMPARISON!>this != null<!>) {
<!DEBUG_INFO_EXPRESSION_TYPE("T")!>this<!>
<!DEBUG_INFO_EXPRESSION_TYPE("T")!>this<!>.equals(null)
<!DEBUG_INFO_EXPRESSION_TYPE("T")!>this<!>.propT
@@ -566,7 +566,7 @@ fun <T> T.case_12() where T : Number?, T: Interface1? {
* ISSUES: KT-28785
*/
fun <T> T.case_13() where T : Out<*>?, T: Comparable<T?> {
if (this != null) {
if (<!SENSELESS_COMPARISON!>this != null<!>) {
<!DEBUG_INFO_EXPRESSION_TYPE("T")!>this<!>
<!DEBUG_INFO_EXPRESSION_TYPE("T")!>this<!>.equals(null)
<!DEBUG_INFO_EXPRESSION_TYPE("T")!>this<!>.propT
@@ -3493,7 +3493,7 @@ fun <T> T.case_56() where T : Number?, T: Interface1? {
* ISSUES: KT-28785
*/
fun <T> T.case_57() where T : Out<*>?, T: Comparable<T?> {
if (this != null) {
if (<!SENSELESS_COMPARISON!>this != null<!>) {
<!DEBUG_INFO_EXPRESSION_TYPE("T")!>this<!>
<!DEBUG_INFO_EXPRESSION_TYPE("T")!>this<!>.equals(null)
<!DEBUG_INFO_EXPRESSION_TYPE("T")!>this<!>.propT
@@ -3798,7 +3798,7 @@ fun <T> T.case_61() where T : InterfaceWithTypeParameter1<T>?, T: Case61_3<T>?,
// TESTCASE NUMBER: 62
fun Nothing?.case_62() {
if (this != null) {
if (<!SENSELESS_COMPARISON!>this != null<!>) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Nothing? & kotlin.Nothing")!>this<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Nothing? & kotlin.Nothing")!>this<!>.hashCode()
@@ -3817,7 +3817,7 @@ fun Nothing?.case_62() {
// TESTCASE NUMBER: 63
fun Nothing.case_63() {
if (this != null) {
if (<!SENSELESS_COMPARISON!>this != null<!>) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Nothing")!>this<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Nothing")!>this<!>.hashCode()
@@ -107,7 +107,7 @@ fun <T> case_4(x: T?) {
// TESTCASE NUMBER: 5
fun <T> case_5(x: T?) {
if (x is Interface1) {
if (x != null) {
if (<!SENSELESS_COMPARISON!>x != null<!>) {
<!DEBUG_INFO_EXPRESSION_TYPE("T? & Interface1 & T?!!")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("T? & Interface1 & T?!!")!>x<!>.equals(null)
x.propT
@@ -387,7 +387,7 @@ fun <T> case_8(x: T) {
// TESTCASE NUMBER: 9
fun <T : Number> case_9(x: T) {
if (x != null) {
if (<!SENSELESS_COMPARISON!>x != null<!>) {
<!DEBUG_INFO_EXPRESSION_TYPE("T")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("T")!>x<!>.equals(null)
<!DEBUG_INFO_EXPRESSION_TYPE("T")!>x<!>.propT
@@ -682,7 +682,7 @@ fun <T> case_12(x: T) where T : Number?, T: Interface1? {
* ISSUES: KT-28785
*/
fun <T> case_13(x: T) where T : Out<*>?, T: Comparable<T?> {
if (x != null) {
if (<!SENSELESS_COMPARISON!>x != null<!>) {
<!DEBUG_INFO_EXPRESSION_TYPE("T")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("T")!>x<!>.equals(null)
<!DEBUG_INFO_EXPRESSION_TYPE("T")!>x<!>.propT
@@ -3986,7 +3986,7 @@ fun <T> case_56(x: T) where T : Number?, T: Interface1? {
* ISSUES: KT-28785
*/
fun <T> case_57(x: T) where T : Out<*>?, T: Comparable<T?> {
if (x != null) {
if (<!SENSELESS_COMPARISON!>x != null<!>) {
<!DEBUG_INFO_EXPRESSION_TYPE("T")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("T")!>x<!>.equals(null)
<!DEBUG_INFO_EXPRESSION_TYPE("T")!>x<!>.propT
@@ -4,7 +4,7 @@
// TESTCASE NUMBER: 1
fun case_1(vararg x: Int?) {
if (x != null) {
if (<!SENSELESS_COMPARISON!>x != null<!>) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Array<out kotlin.Int?>")!>x<!>
x[0]
}
@@ -29,7 +29,7 @@ fun case_2(vararg x: Int?) {
// TESTCASE NUMBER: 3
fun <T> case_3(vararg x: T?) {
if (x != null) {
if (<!SENSELESS_COMPARISON!>x != null<!>) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Array<out T?>")!>x<!>
x[0]
}
@@ -26,7 +26,7 @@ fun case_2(x: Unit?) {
// TESTCASE NUMBER: 3
fun case_3(x: Nothing?) {
if (x != null) else return
if (<!SENSELESS_COMPARISON!>x != null<!>) else return
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Nothing? & kotlin.Nothing")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Nothing? & kotlin.Nothing")!>x<!>.hashCode()
}
@@ -358,7 +358,7 @@ fun case_26(x: Unit?, y: List<*>) {
// TESTCASE NUMBER: 27
fun case_27(x: Nothing?) = (l@ {
if (x != null) else return@l
if (<!SENSELESS_COMPARISON!>x != null<!>) else return@l
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Nothing? & kotlin.Nothing")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Nothing? & kotlin.Nothing")!>x<!>.hashCode()
})()
@@ -26,7 +26,7 @@ fun case_2(x: Unit?) {
// TESTCASE NUMBER: 3
fun case_3(x: Nothing?) {
if (x != null) else throw Exception()
if (<!SENSELESS_COMPARISON!>x != null<!>) else throw Exception()
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Nothing? & kotlin.Nothing")!>x<!>
}
@@ -31,7 +31,7 @@ fun case_2(x: Unit?) {
// TESTCASE NUMBER: 3
fun case_3(x: Nothing?, f: Boolean) {
do {
if (x != null) else break
if (<!SENSELESS_COMPARISON!>x != null<!>) else break
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Nothing? & kotlin.Nothing")!>x<!>.hashCode()
} while (f)
}
@@ -181,21 +181,21 @@ fun case_8(b: Boolean, c: Boolean?) {
val a = Case8_16__2()
if (a.x !== null && false) {
if (false || false || false || false || a.x != null || false || false || false) {
if (a.x !== null && true) {
if (a.x != null && b) {
if (a.x != null && b && !b) {
if (a.x != null && c != null && !c) {
if (a.x !== null && c) {
if (a.x != null && b && b && b && b && b && b && b && b && b && b && b) {
if (a.x != null && !b && !b && !b && !b && !b && !b && !b && !b && !b) {
if (a.x !== null && null == null) {
if (a.x != null && null!!) {
if (a.x != null) {
if (a.x != null) {
if (a.x !== null) {
if (a.x != null) {
if (a.x !== null) {
if (false || false || false || false || <!SENSELESS_COMPARISON!>a.x != null<!> || false || false || false) {
if (<!SENSELESS_COMPARISON!>a.x !== null<!> && true) {
if (<!SENSELESS_COMPARISON!>a.x != null<!> && b) {
if (<!SENSELESS_COMPARISON!>a.x != null<!> && b && !b) {
if (<!SENSELESS_COMPARISON!>a.x != null<!> && c != null && !c) {
if (<!SENSELESS_COMPARISON!>a.x !== null<!> && c) {
if (<!SENSELESS_COMPARISON!>a.x != null<!> && b && b && b && b && b && b && b && b && b && b && b) {
if (<!SENSELESS_COMPARISON!>a.x != null<!> && !b && !b && !b && !b && !b && !b && !b && !b && !b) {
if (<!SENSELESS_COMPARISON!>a.x !== null<!> && <!SENSELESS_COMPARISON!>null == null<!>) {
if (<!SENSELESS_COMPARISON!>a.x != null<!> && null!!) {
if (<!SENSELESS_COMPARISON!>a.x != null<!>) {
if (<!SENSELESS_COMPARISON!>a.x != null<!>) {
if (<!SENSELESS_COMPARISON!>a.x !== null<!>) {
if (<!SENSELESS_COMPARISON!>a.x != null<!>) {
if (<!SENSELESS_COMPARISON!>a.x !== null<!>) {
a.x
a.x.equals(null)
a.x.propT
@@ -408,35 +408,35 @@ fun case_16(b: Boolean, c: Boolean?) {
val a = Case8_16__2()
if (a.x != null && false && false && false && false && false && false) {
if ( a.x == null || false) {
if ( <!SENSELESS_COMPARISON!>a.x == null<!> || false) {
} else {
if ( a.x === null && true) {
if ( <!SENSELESS_COMPARISON!>a.x === null<!> && true) {
} else {
if (a.x == null || !b) {
if (<!SENSELESS_COMPARISON!>a.x == null<!> || !b) {
} else {
if (a.x == null || b || !b) {
if (<!SENSELESS_COMPARISON!>a.x == null<!> || b || !b) {
} else {
if (a.x == null || c == null || !c) {
if (<!SENSELESS_COMPARISON!>a.x == null<!> || c == null || !c) {
} else {
if (a.x === null || c) {
if (<!SENSELESS_COMPARISON!>a.x === null<!> || c) {
} else {
if (a.x == null || b || b || b || b || b || b || b || b || b || b || b) {
if (<!SENSELESS_COMPARISON!>a.x == null<!> || b || b || b || b || b || b || b || b || b || b || b) {
} else {
if (a.x == null || !b || !b || !b || !b || !b || !b || !b || !b || !b) {
if (<!SENSELESS_COMPARISON!>a.x == null<!> || !b || !b || !b || !b || !b || !b || !b || !b || !b) {
} else {
if (a.x === null || null == null) {
if (<!SENSELESS_COMPARISON!>a.x === null<!> || <!SENSELESS_COMPARISON!>null == null<!>) {
} else {
if (a.x == null || null!!) {
if (<!SENSELESS_COMPARISON!>a.x == null<!> || null!!) {
} else {
if (a.x == null) {
if (<!SENSELESS_COMPARISON!>a.x == null<!>) {
} else {
if (a.x == null) {
if (<!SENSELESS_COMPARISON!>a.x == null<!>) {
} else {
if (a.x === null) {
if (<!SENSELESS_COMPARISON!>a.x === null<!>) {
} else {
if (a.x == null) {
if (<!SENSELESS_COMPARISON!>a.x == null<!>) {
} else {
if (a.x === null) {
if (<!SENSELESS_COMPARISON!>a.x === null<!>) {
} else {
a.x
a.x.equals(null)
@@ -22,7 +22,7 @@ fun case_1(x: Any?) {
// TESTCASE NUMBER: 2
fun case_2(x: Nothing?) {
if (x == null) {
if (<!SENSELESS_COMPARISON!>x == null<!>) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Nothing?")!>x<!>
}
}
@@ -60,14 +60,14 @@ fun case_6(x: EmptyClass?) {
// TESTCASE NUMBER: 7
fun case_7() {
if (nullableStringProperty == null || <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String? & kotlin.String")!>nullableStringProperty<!> == null) {
if (nullableStringProperty == null || <!SENSELESS_COMPARISON!><!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String? & kotlin.String")!>nullableStringProperty<!> == null<!>) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String?")!>nullableStringProperty<!>
}
}
// TESTCASE NUMBER: 8
fun case_8(x: TypealiasNullableString) {
if (x == null && <!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableString & kotlin.Nothing?")!>x<!> == null)
if (<!SENSELESS_COMPARISON!>x == null<!> && <!SENSELESS_COMPARISON!><!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableString & kotlin.Nothing?")!>x<!> == null<!>)
<!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableString & kotlin.Nothing?")!>x<!>
}
@@ -102,9 +102,9 @@ fun case_11(x: TypealiasNullableString?, y: TypealiasNullableString) {
if (x != null) {
} else {
if (y == null) {
if (<!SENSELESS_COMPARISON!>y == null<!>) {
if (nullableStringProperty != null) {
if (z == null) {
if (<!SENSELESS_COMPARISON!>z == null<!>) {
<!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableString? & kotlin.Nothing?")!>x<!>
}
}
@@ -113,8 +113,8 @@ fun case_11(x: TypealiasNullableString?, y: TypealiasNullableString) {
}
// TESTCASE NUMBER: 12
fun case_12(x: TypealiasNullableString, y: TypealiasNullableString) = <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String?")!>if (x != null && true && true && true) "1"
else if (y != null) <!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableString")!>x<!>
fun case_12(x: TypealiasNullableString, y: TypealiasNullableString) = <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String?")!>if (<!SENSELESS_COMPARISON!>x != null<!> && true && true && true) "1"
else if (<!SENSELESS_COMPARISON!>y != null<!>) <!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableString")!>x<!>
else "-1"<!>
// TESTCASE NUMBER: 13
@@ -135,21 +135,21 @@ fun case_14() {
val a = Case14()
if (a.x == null) {
if (a.x == null) {
if (a.x == null) {
if (a.x == null) {
if (a.x == null) {
if (a.x == null) {
if (a.x == null) {
if (a.x == null) {
if (a.x == null) {
if (a.x == null) {
if (a.x == null) {
if (a.x == null) {
if (a.x == null) {
if (a.x == null) {
if (a.x == null) {
if (a.x == null) {
if (<!SENSELESS_COMPARISON!>a.x == null<!>) {
if (<!SENSELESS_COMPARISON!>a.x == null<!>) {
if (<!SENSELESS_COMPARISON!>a.x == null<!>) {
if (<!SENSELESS_COMPARISON!>a.x == null<!>) {
if (<!SENSELESS_COMPARISON!>a.x == null<!>) {
if (<!SENSELESS_COMPARISON!>a.x == null<!>) {
if (<!SENSELESS_COMPARISON!>a.x == null<!>) {
if (<!SENSELESS_COMPARISON!>a.x == null<!>) {
if (<!SENSELESS_COMPARISON!>a.x == null<!>) {
if (<!SENSELESS_COMPARISON!>a.x == null<!>) {
if (<!SENSELESS_COMPARISON!>a.x == null<!>) {
if (<!SENSELESS_COMPARISON!>a.x == null<!>) {
if (<!SENSELESS_COMPARISON!>a.x == null<!>) {
if (<!SENSELESS_COMPARISON!>a.x == null<!>) {
if (<!SENSELESS_COMPARISON!>a.x == null<!>) {
a.x
}
}
@@ -171,7 +171,7 @@ fun case_14() {
// TESTCASE NUMBER: 15
fun case_15(x: TypealiasNullableString) {
val t = <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String?")!>if (x != null) "" else {
val t = <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String?")!>if (<!SENSELESS_COMPARISON!>x != null<!>) "" else {
<!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableString & kotlin.Nothing?")!>x<!>
}<!>
}
@@ -180,7 +180,7 @@ fun case_15(x: TypealiasNullableString) {
fun case_16() {
val x: TypealiasNullableNothing = null
if (x == null || false || false || false) {
if (<!SENSELESS_COMPARISON!>x == null<!> || false || false || false) {
<!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableNothing")!>x<!>
}
}
@@ -258,7 +258,7 @@ fun case_23(a: ((Float) -> Int?)?, b: Float?) {
if (a == null && b == null) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Function1<kotlin.Float, kotlin.Int?>? & kotlin.Nothing?")!>a<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Float? & kotlin.Nothing?")!>b<!>
if (a != null) {
if (<!SENSELESS_COMPARISON!>a != null<!>) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Function1<kotlin.Float, kotlin.Int?>? & kotlin.Nothing")!>a<!>
}
}
@@ -96,7 +96,7 @@ fun case_8(x: Boolean?) {
// TESTCASE NUMBER: 9
fun case_9(x: Boolean?) {
while (x ?: return)
while (x == null)
while (<!SENSELESS_COMPARISON!>x == null<!>)
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Boolean? & kotlin.Nothing")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Boolean? & kotlin.Boolean")!>x<!>.equals(10)
@@ -200,7 +200,7 @@ fun case_17(x: Boolean?, y: Boolean?) {
else -> if (true) if (true) if (true) if (true) if (true) x!! else x!! else x!! else x!! else x!! else x!!
}
false -> x!!
null -> if (true) if (true) if (true) if (true) if (true) x!! else x!! else x!! else x!! else x!! else x!!
<!SENSELESS_NULL_IN_WHEN!>null<!> -> if (true) if (true) if (true) if (true) if (true) x!! else x!! else x!! else x!! else x!! else x!!
} else x!! else x!! else x!! else x!! else x!!
}
break@loop
@@ -18,21 +18,21 @@ import otherpackage.*
// TESTCASE NUMBER: 1
fun case_1(x: Any) {
if (x === null) {
if (<!SENSELESS_COMPARISON!>x === null<!>) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any & kotlin.Nothing")!>x<!>
}
}
// TESTCASE NUMBER: 2
fun case_2(x: Nothing) {
if (x == null) {
if (<!SENSELESS_COMPARISON!>x == null<!>) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Nothing")!>x<!>
}
}
// TESTCASE NUMBER: 3
fun case_3() {
if (Object.prop_2 != null)
if (<!SENSELESS_COMPARISON!>Object.prop_2 != null<!>)
else {
Object.prop_2
}
@@ -40,7 +40,7 @@ fun case_3() {
// TESTCASE NUMBER: 4
fun case_4(x: Char) {
if (x == null && true) {
if (<!SENSELESS_COMPARISON!>x == null<!> && true) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Char & kotlin.Nothing")!>x<!>
}
}
@@ -49,33 +49,33 @@ fun case_4(x: Char) {
fun case_5() {
val x: Unit = kotlin.Unit
if (x == null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Unit & kotlin.Nothing")!>x<!>
if (<!SENSELESS_COMPARISON!>x == null<!>) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Unit & kotlin.Nothing")!>x<!>
}
// TESTCASE NUMBER: 6
fun case_6(x: EmptyClass) {
val y = true
if (x == null && !y) {
if (<!SENSELESS_COMPARISON!>x == null<!> && !y) {
<!DEBUG_INFO_EXPRESSION_TYPE("EmptyClass & kotlin.Nothing")!>x<!>
}
}
// TESTCASE NUMBER: 7
fun case_7() {
if (anonymousTypeProperty == null || <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any")!>anonymousTypeProperty<!> == null) {
if (<!SENSELESS_COMPARISON!>anonymousTypeProperty == null<!> || <!SENSELESS_COMPARISON!><!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any")!>anonymousTypeProperty<!> == null<!>) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any")!>anonymousTypeProperty<!>
}
}
// TESTCASE NUMBER: 8
fun case_8(x: TypealiasString) {
if (x == null && <!DEBUG_INFO_EXPRESSION_TYPE("TypealiasString & kotlin.Nothing")!>x<!> == null) <!DEBUG_INFO_EXPRESSION_TYPE("TypealiasString")!>x<!>
if (<!SENSELESS_COMPARISON!>x == null<!> && <!SENSELESS_COMPARISON!><!DEBUG_INFO_EXPRESSION_TYPE("TypealiasString & kotlin.Nothing")!>x<!> == null<!>) <!DEBUG_INFO_EXPRESSION_TYPE("TypealiasString")!>x<!>
}
// TESTCASE NUMBER: 9
fun case_9(x: TypealiasString) {
if (x != null) {
if (<!SENSELESS_COMPARISON!>x != null<!>) {
} else if (false) {
<!DEBUG_INFO_EXPRESSION_TYPE("TypealiasString & kotlin.Nothing")!>x<!>
@@ -86,8 +86,8 @@ fun case_9(x: TypealiasString) {
fun case_10() {
val a = Class()
if (a.prop_5 != null || true) {
if (a.prop_5 == null) {
if (<!SENSELESS_COMPARISON!>a.prop_5 != null<!> || true) {
if (<!SENSELESS_COMPARISON!>a.prop_5 == null<!>) {
a.prop_5
}
}
@@ -97,12 +97,12 @@ fun case_10() {
fun case_11(x: TypealiasString, y: TypealiasString) {
val z: TypealiasString = TypealiasString()
if (x != null) {
if (<!SENSELESS_COMPARISON!>x != null<!>) {
} else {
if (y == null) {
if (stringProperty != null) {
if (false || false || false || z == null || false) {
if (<!SENSELESS_COMPARISON!>y == null<!>) {
if (<!SENSELESS_COMPARISON!>stringProperty != null<!>) {
if (false || false || false || <!SENSELESS_COMPARISON!>z == null<!> || false) {
<!DEBUG_INFO_EXPRESSION_TYPE("TypealiasString & kotlin.Nothing")!>x<!>
}
}
@@ -111,13 +111,13 @@ fun case_11(x: TypealiasString, y: TypealiasString) {
}
// TESTCASE NUMBER: 12
fun case_12(x: TypealiasString, y: TypealiasString) = <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>if (x != null) "1"
else if (y !== null) <!DEBUG_INFO_EXPRESSION_TYPE("TypealiasString & kotlin.Nothing")!>x<!>
fun case_12(x: TypealiasString, y: TypealiasString) = <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>if (<!SENSELESS_COMPARISON!>x != null<!>) "1"
else if (<!SENSELESS_COMPARISON!>y !== null<!>) <!DEBUG_INFO_EXPRESSION_TYPE("TypealiasString & kotlin.Nothing")!>x<!>
else "-1"<!>
// TESTCASE NUMBER: 13
fun case_13(x: otherpackage.EmptyClass13) =
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int")!>if (x != null) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int")!>if (<!SENSELESS_COMPARISON!>x != null<!>) {
1
} else <!DEBUG_INFO_EXPRESSION_TYPE("otherpackage.EmptyClass13 & kotlin.Nothing")!>x<!><!>
@@ -132,22 +132,22 @@ class A14 {
fun case_14() {
val a = A14()
if (a.x == null) {
if (a.x == null) {
if (a.x == null) {
if (a.x === null) {
if (a.x == null) {
if (a.x == null) {
if (a.x == null) {
if (a.x == null) {
if (a.x === null) {
if (a.x == null) {
if (a.x == null) {
if (a.x == null) {
if (a.x == null) {
if (a.x == null) {
if (a.x == null) {
if (a.x === null) {
if (<!SENSELESS_COMPARISON!>a.x == null<!>) {
if (<!SENSELESS_COMPARISON!>a.x == null<!>) {
if (<!SENSELESS_COMPARISON!>a.x == null<!>) {
if (<!SENSELESS_COMPARISON!>a.x === null<!>) {
if (<!SENSELESS_COMPARISON!>a.x == null<!>) {
if (<!SENSELESS_COMPARISON!>a.x == null<!>) {
if (<!SENSELESS_COMPARISON!>a.x == null<!>) {
if (<!SENSELESS_COMPARISON!>a.x == null<!>) {
if (<!SENSELESS_COMPARISON!>a.x === null<!>) {
if (<!SENSELESS_COMPARISON!>a.x == null<!>) {
if (<!SENSELESS_COMPARISON!>a.x == null<!>) {
if (<!SENSELESS_COMPARISON!>a.x == null<!>) {
if (<!SENSELESS_COMPARISON!>a.x == null<!>) {
if (<!SENSELESS_COMPARISON!>a.x == null<!>) {
if (<!SENSELESS_COMPARISON!>a.x == null<!>) {
if (<!SENSELESS_COMPARISON!>a.x === null<!>) {
a.x
}
}
@@ -169,7 +169,7 @@ fun case_14() {
// TESTCASE NUMBER: 15
fun case_15(x: TypealiasString) {
val t = <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>if (true && x != null) "" else {
val t = <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>if (true && <!SENSELESS_COMPARISON!>x != null<!>) "" else {
<!DEBUG_INFO_EXPRESSION_TYPE("TypealiasString")!>x<!>
}<!>
}
@@ -178,7 +178,7 @@ fun case_15(x: TypealiasString) {
fun case_16() {
val x: TypealiasNothing = return
if (x == null) {
if (<!SENSELESS_COMPARISON!>x == null<!>) {
<!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNothing")!>x<!>
}
}
@@ -188,13 +188,13 @@ fun case_16() {
* UNEXPECTED BEHAVIOUR
* ISSUES: KT-28329
*/
val case_17 = <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int")!>if (true && true && intProperty != null) 0 else {
val case_17 = <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int")!>if (true && true && <!SENSELESS_COMPARISON!>intProperty != null<!>) 0 else {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int")!>intProperty<!>
}<!>
//TESTCASE NUMBER: 18
fun case_18(a: DeepObject.A.B.C.D.E.F.G.J) {
if (a == null) {
if (<!SENSELESS_COMPARISON!>a == null<!>) {
<!DEBUG_INFO_EXPRESSION_TYPE("DeepObject.A.B.C.D.E.F.G.J & kotlin.Nothing")!>a<!>
}
}
@@ -219,7 +219,7 @@ fun case_19(b: Boolean) {
}
} else null
if (a != null && a.B19 != null && a.B19.C19 != null && a.B19.C19.D19 != null && a.B19.C19.D19.x == null) {
if (a != null && a.B19 != null && a.B19.C19 != null && a.B19.C19.D19 != null && <!SENSELESS_COMPARISON!>a.B19.C19.D19.x == null<!>) {
a.B19.C19.D19.x
}
}
@@ -234,30 +234,30 @@ fun case_20() {
}
}
if (a.B19.C19.D19 === null) {
if (<!SENSELESS_COMPARISON!>a.B19.C19.D19 === null<!>) {
a.B19.C19.D19
}
}
// TESTCASE NUMBER: 21
fun case_21() {
if (EnumClassWithProperty.B.prop_1 == null || false || false || false || false || false || false || false) {
if (<!SENSELESS_COMPARISON!>EnumClassWithProperty.B.prop_1 == null<!> || false || false || false || false || false || false || false) {
EnumClassWithProperty.B.prop_1
}
}
// TESTCASE NUMBER: 22
fun case_22(a: (() -> Unit)) {
if (a == null) {
if (<!SENSELESS_COMPARISON!>a == null<!>) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Unit")!>a()<!>
}
}
// TESTCASE NUMBER: 23
fun case_23(a: ((Float) -> Int), b: Float) {
if (a == null && b == null) {
if (<!SENSELESS_COMPARISON!>a == null<!> && <!SENSELESS_COMPARISON!>b == null<!>) {
val x = <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int")!>a(<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Float & kotlin.Nothing")!>b<!>)<!>
if (x !== null) {
if (<!SENSELESS_COMPARISON!>x !== null<!>) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int")!>x<!>
}
}
@@ -269,20 +269,20 @@ fun case_23(a: ((Float) -> Int), b: Float) {
* ISSUES: KT-28329
*/
fun case_24(a: ((() -> Unit) -> Unit), b: (() -> Unit)) {
if (false || false || a == null && b === null) {
if (false || false || <!SENSELESS_COMPARISON!>a == null<!> && <!SENSELESS_COMPARISON!>b === null<!>) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Function1<kotlin.Function0<kotlin.Unit>, kotlin.Unit>")!>a<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Function0<kotlin.Unit>")!>b<!>
}
}
// TESTCASE NUMBER: 25
fun case_25(a: (() -> Unit) -> Unit, b: (() -> Unit) -> Unit = if (a == null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Function1<kotlin.Function0<kotlin.Unit>, kotlin.Unit> & kotlin.Nothing")!>a<!> else {{}}) {
fun case_25(a: (() -> Unit) -> Unit, b: (() -> Unit) -> Unit = if (<!SENSELESS_COMPARISON!>a == null<!>) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Function1<kotlin.Function0<kotlin.Unit>, kotlin.Unit> & kotlin.Nothing")!>a<!> else {{}}) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Function1<kotlin.Function0<kotlin.Unit>, kotlin.Unit>")!>a<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Function1<kotlin.Function0<kotlin.Unit>, kotlin.Unit>")!>b<!>
}
// TESTCASE NUMBER: 26
fun case_26(a: Int, b: Int = if (a === null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int & kotlin.Nothing")!>a<!> else 0) {
fun case_26(a: Int, b: Int = if (<!SENSELESS_COMPARISON!>a === null<!>) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int & kotlin.Nothing")!>a<!> else 0) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int")!>a<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int")!>b<!>
}
@@ -65,7 +65,7 @@ fun case_5() {
val x: Int?
val y: Int?
x = 10;y = x
if (y != null) {
if (<!SENSELESS_COMPARISON!>y != null<!>) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int")!>x<!>.inv()
}
@@ -76,7 +76,7 @@ fun case_6() {
var x: Int?
val y: Int?
x = 10;y = x
if (y != null) {
if (<!SENSELESS_COMPARISON!>y != null<!>) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int")!>x<!>.inv()
}
@@ -87,7 +87,7 @@ fun case_7() {
val x: Int?
var y: Int?
x = 10;y = x
if (y != null) {
if (<!SENSELESS_COMPARISON!>y != null<!>) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int")!>x<!>.inv()
}
@@ -98,7 +98,7 @@ fun case_8() {
var x: Int?
var y: Int?
x = 10;y = x
if (y != null) {
if (<!SENSELESS_COMPARISON!>y != null<!>) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Int")!>x<!>.inv()
}
@@ -19,7 +19,7 @@ fun case_2(x: Int?) = 10
fun case_2() {
var x: Int? = 10
var y = { x = null }
if (x != null) {
if (<!SENSELESS_COMPARISON!>x != null<!>) {
val z = case_2(<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Nothing")!>x<!>)
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>z<!>
}
@@ -13,7 +13,7 @@ fun case_1() {
do {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>x<!>
x = x<!UNSAFE_CALL!>.<!>equals(10)
} while (x != null)
} while (<!SENSELESS_COMPARISON!>x != null<!>)
}
/*
@@ -27,7 +27,7 @@ fun case_2() {
do {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>x<!>
x = x<!UNSAFE_CALL!>.<!>equals(10)
} while (x !== null)
} while (<!SENSELESS_COMPARISON!>x !== null<!>)
}
// TESTCASE NUMBER: 3
@@ -59,7 +59,7 @@ fun case_5() {
do {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>x<!>
x = x<!UNSAFE_CALL!>.<!>equals(10)
} while (x !== null)
} while (<!SENSELESS_COMPARISON!>x !== null<!>)
}
/*
@@ -73,7 +73,7 @@ fun case_6() {
do {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>x<!>
x = x<!UNSAFE_CALL!>.<!>equals(10)
} while (x != null)
} while (<!SENSELESS_COMPARISON!>x != null<!>)
}
/*
@@ -87,7 +87,7 @@ fun case_7() {
do {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>x<!>
x = x<!UNSAFE_CALL!>.<!>equals(10)
} while (x !== null)
} while (<!SENSELESS_COMPARISON!>x !== null<!>)
}
/*
@@ -101,7 +101,7 @@ fun case_8() {
do {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>x<!>
x = x<!UNSAFE_CALL!>.<!>equals(10)
} while (x != null)
} while (<!SENSELESS_COMPARISON!>x != null<!>)
}
/*
@@ -115,7 +115,7 @@ fun case_9() {
do {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>x<!>
x = x<!UNSAFE_CALL!>.<!>equals(10)
} while (x !== null)
} while (<!SENSELESS_COMPARISON!>x !== null<!>)
}
/*
@@ -129,7 +129,7 @@ fun case_10() {
do {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>x<!>
x = x<!UNSAFE_CALL!>.<!>equals(10)
} while (x != null)
} while (<!SENSELESS_COMPARISON!>x != null<!>)
}
/*
@@ -143,7 +143,7 @@ fun case_11() {
do {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>x<!>
x = x<!UNSAFE_CALL!>.<!>equals(10)
} while (x != null)
} while (<!SENSELESS_COMPARISON!>x != null<!>)
}
/*
@@ -157,7 +157,7 @@ fun case_12() {
do {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>x<!>
x = x <!UNSAFE_CALL!>.<!>equals(10)
} while (x != null)
} while (<!SENSELESS_COMPARISON!>x != null<!>)
}
}
@@ -172,7 +172,7 @@ fun case_13() {
do {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>x<!>
x = x <!UNSAFE_CALL!>.<!>equals(10)
} while (x != null)
} while (<!SENSELESS_COMPARISON!>x != null<!>)
}
}
@@ -281,7 +281,7 @@ fun case_14() {
// TESTCASE NUMBER: 15
fun case_15(x: TypealiasNullableString) {
val y = null
val z = if (x === null || y == x && x === y || null === x) "" else {
val z = if (<!SENSELESS_COMPARISON!>x === null<!> || y == x && x === y || <!SENSELESS_COMPARISON!>null === x<!>) "" else {
<!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableString & kotlin.Any & TypealiasNullableString")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableString & kotlin.Any & TypealiasNullableString")!>x<!>.equals(null)
<!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableString & kotlin.Any & TypealiasNullableString")!>x<!>.propT
@@ -9,7 +9,7 @@ fun case_1() {
outer@ while (x != null) {
inner@ do {
x = null
} while (x == null)
} while (<!SENSELESS_COMPARISON!>x == null<!>)
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String? & kotlin.Nothing")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String? & kotlin.Nothing")!>x<!>.length
}
@@ -34,7 +34,7 @@ fun case_2(x: Any) {
val y = when(x) {
true -> "true"
false -> "false"
null -> "false"
<!SENSELESS_NULL_IN_WHEN!>null<!> -> "false"
}
}
@@ -98,7 +98,7 @@ fun case_7(x: Any) {
val y = when(x) {
true -> "true"
false -> "false"
null -> "false"
<!SENSELESS_NULL_IN_WHEN!>null<!> -> "false"
}
}
}
@@ -155,7 +155,7 @@ fun case_10(x: Any): String {
fun case_11(x: Any?): String? {
if (x is Nothing?) {
return when(x) {
null -> null
<!SENSELESS_NULL_IN_WHEN!>null<!> -> null
}
}
return ""
@@ -169,7 +169,7 @@ fun case_11(x: Any?): String? {
fun case_12(x: Any?): String? {
if (x == null) {
return when(x) {
null -> null
<!SENSELESS_NULL_IN_WHEN!>null<!> -> null
}
}
return ""
@@ -183,7 +183,7 @@ fun case_12(x: Any?): String? {
fun case_13(x: Any?): String? {
if (x === null) {
return when(x) {
null -> null
<!SENSELESS_NULL_IN_WHEN!>null<!> -> null
}
}
return ""
@@ -197,7 +197,7 @@ fun case_13(x: Any?): String? {
fun case_14(x: Any?): String? {
x as Nothing?
return when(x) {
null -> null
<!SENSELESS_NULL_IN_WHEN!>null<!> -> null
}
}
@@ -220,7 +220,7 @@ fun case_16(x: Any) {
EnumClass.SOUTH -> 2
EnumClass.WEST -> 3
EnumClass.EAST -> 4
null -> 5
<!SENSELESS_NULL_IN_WHEN!>null<!> -> 5
}
}
}
@@ -256,7 +256,7 @@ fun case_19(x: Any): Int {
EnumClass.SOUTH -> 2
EnumClass.WEST -> 3
EnumClass.EAST -> 4
null -> 5
<!SENSELESS_NULL_IN_WHEN!>null<!> -> 5
}
}
return 0
@@ -323,7 +323,7 @@ fun case_25(x: Any) {
is SealedChild1 -> 1
is SealedChild2 -> 2
is SealedChild3 -> 3
null -> 5
<!SENSELESS_NULL_IN_WHEN!>null<!> -> 5
}
}
}
@@ -356,7 +356,7 @@ fun case_28(x: Any): Int {
is SealedChild1 -> 1
is SealedChild2 -> 2
is SealedChild3 -> 3
null -> 5
<!SENSELESS_NULL_IN_WHEN!>null<!> -> 5
}
}
return 0
@@ -401,7 +401,7 @@ fun case_32(x: Any) {
SealedWithObjectsChild1 -> 1
SealedWithObjectsChild2 -> 2
SealedWithObjectsChild3 -> 3
null -> 5
<!SENSELESS_NULL_IN_WHEN!>null<!> -> 5
}
}
}
@@ -434,7 +434,7 @@ fun case_35(x: Any): Int {
SealedWithObjectsChild1 -> 1
SealedWithObjectsChild2 -> 2
SealedWithObjectsChild3 -> 3
null -> 5
<!SENSELESS_NULL_IN_WHEN!>null<!> -> 5
}
}
return 0
@@ -18,7 +18,7 @@ import orherpackage.*
// TESTCASE NUMBER: 1
fun case_1(x: Any?) {
if (x != null || x != null || x != null || x != null || x != null || x != null || x != null) {
if (x != null || <!SENSELESS_COMPARISON!>x != null<!> || <!SENSELESS_COMPARISON!>x != null<!> || <!SENSELESS_COMPARISON!>x != null<!> || <!SENSELESS_COMPARISON!>x != null<!> || <!SENSELESS_COMPARISON!>x != null<!> || <!SENSELESS_COMPARISON!>x != null<!>) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>.equals(null)
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>.propT
@@ -38,14 +38,14 @@ fun case_1(x: Any?) {
* ISSUES: KT-28159
*/
fun case_2(x: Nothing?) {
if (x !== null && x !== null) {
if (<!SENSELESS_COMPARISON!>x !== null<!> && <!SENSELESS_COMPARISON!>x !== null<!>) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Nothing?")!>x<!>
}
}
// TESTCASE NUMBER: 3
fun case_3() {
if (Object.prop_1 == null && Object.prop_1 == null)
if (Object.prop_1 == null && <!SENSELESS_COMPARISON!>Object.prop_1 == null<!>)
else {
Object.prop_1
Object.prop_1.equals(null)
@@ -80,7 +80,7 @@ fun case_4(x: Char?) {
fun case_5() {
val x: Unit? = null
if (x !== null || x !== null && x !== null || x !== null && x !== null) {
if (x !== null || <!SENSELESS_COMPARISON!>x !== null<!> && <!SENSELESS_COMPARISON!>x !== null<!> || <!SENSELESS_COMPARISON!>x !== null<!> && <!SENSELESS_COMPARISON!>x !== null<!>) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Unit?")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Unit?")!>x<!><!UNSAFE_CALL!>.<!>equals(null)
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Unit?")!>x<!>.propT
@@ -115,7 +115,7 @@ fun case_6(x: Class?) {
// TESTCASE NUMBER: 7
fun case_7() {
val x: EmptyObject? = null
if (x != null || x != null || <!DEBUG_INFO_EXPRESSION_TYPE("EmptyObject? & kotlin.Nothing?")!>x<!> != null) {
if (x != null || <!SENSELESS_COMPARISON!>x != null<!> || <!SENSELESS_COMPARISON!><!DEBUG_INFO_EXPRESSION_TYPE("EmptyObject? & kotlin.Nothing?")!>x<!> != null<!>) {
<!DEBUG_INFO_EXPRESSION_TYPE("EmptyObject? & EmptyObject")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("EmptyObject? & EmptyObject")!>x<!>.equals(null)
<!DEBUG_INFO_EXPRESSION_TYPE("EmptyObject? & EmptyObject")!>x<!>.propT
@@ -131,7 +131,7 @@ fun case_7() {
// TESTCASE NUMBER: 8
fun case_8(x: TypealiasString) {
if (x !== null && <!DEBUG_INFO_EXPRESSION_TYPE("TypealiasString")!>x<!> != null) {
if (<!SENSELESS_COMPARISON!>x !== null<!> && <!SENSELESS_COMPARISON!><!DEBUG_INFO_EXPRESSION_TYPE("TypealiasString")!>x<!> != null<!>) {
<!DEBUG_INFO_EXPRESSION_TYPE("TypealiasString")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("TypealiasString")!>x<!>.equals(null)
<!DEBUG_INFO_EXPRESSION_TYPE("TypealiasString")!>x<!>.propT
@@ -147,9 +147,9 @@ fun case_8(x: TypealiasString) {
// TESTCASE NUMBER: 9
fun case_9(x: TypealiasNullableString?) {
if (x === null && x === null || x === null) {
if (x === null && <!SENSELESS_COMPARISON!>x === null<!> || <!SENSELESS_COMPARISON!>x === null<!>) {
} else if (x === null || x === null) {
} else if (<!SENSELESS_COMPARISON!>x === null<!> || <!SENSELESS_COMPARISON!>x === null<!>) {
} else if (false) {
<!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableString? & kotlin.Any & TypealiasNullableString")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableString? & kotlin.Any & TypealiasNullableString")!>x<!>.equals(null)
@@ -168,7 +168,7 @@ fun case_9(x: TypealiasNullableString?) {
fun case_10() {
val a = Class()
if (a.prop_4 === null || a.prop_4 === null || true) {
if (a.prop_4 === null || <!SENSELESS_COMPARISON!>a.prop_4 === null<!> || true) {
if (a.prop_4 != null) {
a.prop_4
a.prop_4.equals(null)
@@ -191,10 +191,10 @@ fun case_11(x: TypealiasNullableString?, y: TypealiasNullableString) {
if (x == null) {
} else {
if (x != null) {
if (y != null || y != null) {
if (stringProperty == null && nullableNothingProperty == null) {
if (t != null || t != null) {
if (<!SENSELESS_COMPARISON!>x != null<!>) {
if (<!SENSELESS_COMPARISON!>y != null<!> || <!SENSELESS_COMPARISON!>y != null<!>) {
if (<!SENSELESS_COMPARISON!>stringProperty == null<!> && <!SENSELESS_COMPARISON!>nullableNothingProperty == null<!>) {
if (<!SENSELESS_COMPARISON!>t != null<!> || <!SENSELESS_COMPARISON!>t != null<!>) {
<!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableString? & kotlin.Any & TypealiasNullableString")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableString? & kotlin.Any & TypealiasNullableString")!>x<!>.equals(null)
<!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableString? & kotlin.Any & TypealiasNullableString")!>x<!>.propT
@@ -213,8 +213,8 @@ fun case_11(x: TypealiasNullableString?, y: TypealiasNullableString) {
}
// TESTCASE NUMBER: 12
fun case_12(x: TypealiasNullableString, y: TypealiasNullableString) = <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>if (x == null) "1"
else if (y === null || y === null) {
fun case_12(x: TypealiasNullableString, y: TypealiasNullableString) = <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!>if (<!SENSELESS_COMPARISON!>x == null<!>) "1"
else if (<!SENSELESS_COMPARISON!>y === null<!> || <!SENSELESS_COMPARISON!>y === null<!>) {
<!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableString & kotlin.Any & TypealiasNullableString")!>x<!>.equals(null)
<!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableString & kotlin.Any & TypealiasNullableString")!>x<!>.propT
<!DEBUG_INFO_EXPRESSION_TYPE("TypealiasNullableString & kotlin.Any & TypealiasNullableString")!>x<!>.propAny
@@ -56,7 +56,7 @@ fun case_2(a: Inv<Inv<Inv<Inv<Inv<Inv<Int?>?>?>?>?>?>?) {
fun case_3(a: Inv<Int>?) {
if (a != null) {
val b = a
if (a == null) {
if (<!SENSELESS_COMPARISON!>a == null<!>) {
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<kotlin.Int>? & kotlin.Nothing")!>b<!>
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<kotlin.Int>? & kotlin.Nothing")!>b<!>.equals(null)
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<kotlin.Int>? & kotlin.Nothing")!>b<!>.propT
@@ -60,7 +60,7 @@ fun case_2(a: Out<<!REDUNDANT_PROJECTION!>out<!> Out<<!REDUNDANT_PROJECTION!>out
fun case_3(a: Inv<out Int>?) {
if (a != null) {
val b = a
if (a == null)
if (<!SENSELESS_COMPARISON!>a == null<!>)
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<out kotlin.Int>? & kotlin.Nothing")!>b<!>
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<out kotlin.Int>? & Inv<out kotlin.Int>")!>b<!>.equals(null)
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<out kotlin.Int>? & Inv<out kotlin.Int>")!>b<!>.propT
@@ -438,7 +438,7 @@ fun case_18(a: Inv<out Int?>) {
* ISSUES: KT-28785
*/
fun case_19(a: Inv<out Nothing?>) {
if (a.x != null) {
if (<!SENSELESS_COMPARISON!>a.x != null<!>) {
a.x
a.x.hashCode()
}
@@ -490,7 +490,7 @@ fun case_21(a: Out<<!REDUNDANT_PROJECTION!>out<!> Int?>) {
* ISSUES: KT-28785
*/
fun case_22(a: Out<<!REDUNDANT_PROJECTION!>out<!> Nothing?>) {
if (a.x != null) {
if (<!SENSELESS_COMPARISON!>a.x != null<!>) {
a.x
a.x.hashCode()
}
@@ -534,7 +534,7 @@ fun case_24(a: Out<Int?>) {
// TESTCASE NUMBER: 25
fun case_25(a: Out<Nothing?>) {
if (a.x != null) {
if (<!SENSELESS_COMPARISON!>a.x != null<!>) {
a.x
a.x.hashCode()
}
@@ -13,7 +13,7 @@ open class Foo(val prop: Int) {
}
fun box(): String? {
if (Foo(42) == null) return null
if (<!SENSELESS_COMPARISON!>Foo(42) == null<!>) return null
return "OK"
}
@@ -13,7 +13,7 @@ open class Foo(val prop: Int) {
}
fun box(): String? {
if (Foo(42) == null) return null
if (<!SENSELESS_COMPARISON!>Foo(42) == null<!>) return null
return "OK"
}
@@ -13,7 +13,7 @@ open class Foo(val prop: Int) {
}
fun box(): String? {
if (Foo.MyObject == null) return null
if (<!SENSELESS_COMPARISON!>Foo.MyObject == null<!>) return null
return "OK"
}
@@ -13,7 +13,7 @@ open class Foo(val prop: Int) {
}
fun box(): String? {
if (Foo(42) == null) return null
if (<!SENSELESS_COMPARISON!>Foo(42) == null<!>) return null
return "OK"
}
@@ -13,7 +13,7 @@ open class Foo(val prop: Int) {
}
fun box(): String? {
if (Foo(42) == null) return null
if (<!SENSELESS_COMPARISON!>Foo(42) == null<!>) return null
return "OK"
}
@@ -13,7 +13,7 @@ open class Foo(val prop: Int) {
}
fun box(): String? {
if (Foo(42) == null) return null
if (<!SENSELESS_COMPARISON!>Foo(42) == null<!>) return null
return "OK"
}
@@ -13,7 +13,7 @@ open class Foo(val prop: Int) {
}
fun box(): String? {
if (Foo.MyObject == null) return null
if (<!SENSELESS_COMPARISON!>Foo.MyObject == null<!>) return null
return "OK"
}