[FIR] Check is for impossibility

^KT-58203 Fixed
^KT-62646
This commit is contained in:
Nikolay Lunyak
2024-02-29 15:39:33 +02:00
committed by Space Team
parent 92d8da621e
commit 88ff93df7f
42 changed files with 110 additions and 83 deletions
@@ -17,7 +17,7 @@ fun test_2(x: Any) {
fun test_3(x: Any) {
when {
x !is String -> {}
x !is Int -> {}
<!USELESS_IS_CHECK!>x !is Int<!> -> {}
else -> {
x.length
x.inc()
@@ -16,7 +16,7 @@ fun test_1(x: Any?) {
when {
x !is A -> {}
x !is B -> x.foo()
x is Int -> {
<!USELESS_IS_CHECK!>x is Int<!> -> {
x.foo()
x.bar()
x.inc()
@@ -37,7 +37,7 @@ fun test_2(x: Any?) {
when(x) {
!is A -> {}
!is B -> x.foo()
is Int -> {
<!USELESS_IS_CHECK!>is Int<!> -> {
x.foo()
x.bar()
x.inc()
@@ -67,7 +67,7 @@ fun test_3(x: Any?) {
x.foo()
y.foo()
}
is Int -> {
<!USELESS_IS_CHECK!>is Int<!> -> {
x.foo()
x.bar()
x.inc()