FIR DFA: x !is T? => x != null
^KT-22996 tag fixed-in-k2
This commit is contained in:
@@ -36,12 +36,12 @@ inline fun <reified T> case_3(x: Any?) {
|
||||
when (x) {
|
||||
is T? -> return
|
||||
else -> {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>x<!><!UNSAFE_CALL!>.<!>equals(10)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>.equals(10)
|
||||
}
|
||||
}
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>x<!><!UNSAFE_CALL!>.<!>equals(10)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>.equals(10)
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 4
|
||||
@@ -70,8 +70,8 @@ inline fun <reified T> case_5(x: Any?) {
|
||||
// TESTCASE NUMBER: 6
|
||||
inline fun <reified T> case_6(x: Any?) {
|
||||
if (x is T?) return
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>x<!><!UNSAFE_CALL!>.<!>equals(10)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>.equals(10)
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 7
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
*/
|
||||
fun case_1(x: Number?): Long? {
|
||||
if (x is Long?) return x
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Number?")!>x<!>
|
||||
return <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Number?")!>x<!><!UNSAFE_CALL!>.<!>toLong()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Number? & kotlin.Number")!>x<!>
|
||||
return <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Number? & kotlin.Number")!>x<!>.toLong()
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -38,8 +38,8 @@ fun case_4(x: Any) {
|
||||
fun case_5(x: Any?) {
|
||||
if (!(x !is Class.NestedClass?) || x is Class.NestedClass? || x !is Class.NestedClass?) {
|
||||
if (!!(x !is Class.NestedClass?)) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>x<!>.<!UNRESOLVED_REFERENCE!>prop_4<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>.<!UNRESOLVED_REFERENCE!>prop_4<!>
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -72,8 +72,8 @@ fun case_8(x: Any?) {
|
||||
fun case_9(x: Any?) {
|
||||
if (!!!(x !is TypealiasNullableStringIndirect<!REDUNDANT_NULLABLE!>?<!>)) else {
|
||||
if (!(x !is TypealiasNullableStringIndirect<!REDUNDANT_NULLABLE!>?<!>)) else {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>x<!>?.<!UNRESOLVED_REFERENCE!>get<!>(0)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!><!UNNECESSARY_SAFE_CALL!>?.<!><!UNRESOLVED_REFERENCE!>get<!>(0)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -93,9 +93,9 @@ fun case_10(x: Any?) {
|
||||
fun case_11(x: Any?) {
|
||||
if (x is SealedMixedChildObject1?) else {
|
||||
if (x is SealedMixedChildObject1?) else {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>x<!>?.<!UNRESOLVED_REFERENCE!>prop_1<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>x<!>?.<!UNRESOLVED_REFERENCE!>prop_2<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!><!UNNECESSARY_SAFE_CALL!>?.<!><!UNRESOLVED_REFERENCE!>prop_1<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any")!>x<!><!UNNECESSARY_SAFE_CALL!>?.<!><!UNRESOLVED_REFERENCE!>prop_2<!>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,8 +46,8 @@ fun case_4(x: Any) {
|
||||
fun case_5(x: Any?) {
|
||||
if (!(x !is Class.NestedClass?)) {
|
||||
if (!!(<!USELESS_IS_CHECK!>x !is Class.NestedClass?<!>)) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & Class.NestedClass?")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & Class.NestedClass?")!>x<!>?.prop_4
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & Class.NestedClass")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & Class.NestedClass")!>x<!><!UNNECESSARY_SAFE_CALL!>?.<!>prop_4
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -76,8 +76,8 @@ fun case_7(x: Any) {
|
||||
fun case_8(x: Any?) {
|
||||
if (!!!!(x is Int?)) else {
|
||||
if (!(x is Int?)) else {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Int?")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Int?")!>x<!>?.inv()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Int")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Int")!>x<!><!UNNECESSARY_SAFE_CALL!>?.<!>inv()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -86,8 +86,8 @@ fun case_8(x: Any?) {
|
||||
fun case_9(x: Any?) {
|
||||
if (!!!(x !is TypealiasNullableStringIndirect<!REDUNDANT_NULLABLE!>?<!>)) else {
|
||||
if (!!(x !is TypealiasNullableStringIndirect<!REDUNDANT_NULLABLE!>?<!>)) else {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & TypealiasNullableStringIndirect?")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & TypealiasNullableStringIndirect?")!>x<!>?.get(0)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any & TypealiasNullableStringIndirect")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Any & TypealiasNullableStringIndirect")!>x<!><!UNNECESSARY_SAFE_CALL!>?.<!>get(0)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -207,7 +207,7 @@ fun case_10(x: Any?) {
|
||||
if (x is ClassLevel1? && x is ClassLevel2? && x is ClassLevel3?) {
|
||||
if (x is ClassLevel4?) {
|
||||
|
||||
} else if (x is ClassLevel5? && x != null) {
|
||||
} else if (x is ClassLevel5? && <!SENSELESS_COMPARISON!>x != null<!>) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & ClassLevel5")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & ClassLevel5")!>x<!>.equals(null)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & ClassLevel5")!>x<!>.propT
|
||||
@@ -224,7 +224,7 @@ fun case_10(x: Any?) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & ClassLevel5")!>x<!>.test4()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & ClassLevel5")!>x<!>.test5()
|
||||
}
|
||||
} else if (x is ClassLevel4? && x != null && x is ClassLevel5?) {
|
||||
} else if (x is ClassLevel4? && <!SENSELESS_COMPARISON!>x != null<!> && x is ClassLevel5?) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & ClassLevel5")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & ClassLevel5")!>x<!>.equals(null)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & ClassLevel5")!>x<!>.propT
|
||||
|
||||
@@ -1255,7 +1255,7 @@ fun case_70(x: Any?) {
|
||||
if (x is ClassLevel1? && x is ClassLevel2? && x is ClassLevel3?) {
|
||||
if (x is ClassLevel4?) {
|
||||
|
||||
} else if (x is ClassLevel5? && x != nullableNothingProperty || x != implicitNullableNothingProperty) {
|
||||
} else if (x is ClassLevel5? && <!SENSELESS_COMPARISON!>x != nullableNothingProperty<!> || <!SENSELESS_COMPARISON!>x != implicitNullableNothingProperty<!>) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & ClassLevel3")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & ClassLevel3")!>x<!>.equals(null)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & ClassLevel3")!>x<!>.propT
|
||||
@@ -1267,7 +1267,7 @@ fun case_70(x: Any?) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & ClassLevel3")!>x<!>.funNullableT()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & ClassLevel3")!>x<!>.funNullableAny()
|
||||
}
|
||||
} else if (x is ClassLevel4? && x !== nullableNothingProperty && x is ClassLevel5?) {
|
||||
} else if (x is ClassLevel4? && <!SENSELESS_COMPARISON!>x !== nullableNothingProperty<!> && x is ClassLevel5?) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & ClassLevel5")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & ClassLevel5")!>x<!>.equals(null)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & ClassLevel5")!>x<!>.propT
|
||||
|
||||
@@ -59,7 +59,7 @@ fun case_7(x: Any?) {
|
||||
// TESTCASE NUMBER: 8
|
||||
fun case_8(x: Any?) {
|
||||
if (x as String? == null) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.String?")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.String?")!>x<!><!UNSAFE_CALL!>.<!>length
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Nothing?")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Nothing?")!>x<!><!UNSAFE_CALL!>.<!>length
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user