FIR checker: warn useless as and is

This commit is contained in:
Jinseong Jeon
2021-04-28 22:32:51 -07:00
committed by TeamCityServer
parent 19d939c36e
commit e2dc21da90
141 changed files with 417 additions and 543 deletions
@@ -12,7 +12,7 @@ fun case_1(x: Nothing?) {
// TESTCASE NUMBER: 2
fun case_2(x: Nothing) {
if (x is Unit) {
if (<!USELESS_IS_CHECK!>x is Unit<!>) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Nothing")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Nothing")!>x<!>.inv()
}
@@ -28,7 +28,7 @@ fun case_3(x: Nothing?) {
// TESTCASE NUMBER: 4
fun case_4(x: Nothing) {
if (x !is EnumClass) else {
if (<!USELESS_IS_CHECK!>x !is EnumClass<!>) else {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Nothing")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Nothing")!>x<!>.<!UNRESOLVED_REFERENCE!>fun_1<!>()
}
@@ -36,7 +36,7 @@ fun case_4(x: Nothing) {
// TESTCASE NUMBER: 5
fun case_5(x: Nothing?) {
if (!(x !is Class.NestedClass?)) {
if (!(<!USELESS_IS_CHECK!>x !is Class.NestedClass?<!>)) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Nothing?")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Nothing?")!>x<!>?.<!UNRESOLVED_REFERENCE!>prop_4<!>
}
@@ -52,7 +52,7 @@ fun case_6(x: Nothing?) {
// TESTCASE NUMBER: 7
fun case_7(x: Nothing) {
if (!(x is DeepObject.A.B.C.D.E.F.G.J)) else {
if (!(<!USELESS_IS_CHECK!>x is DeepObject.A.B.C.D.E.F.G.J<!>)) else {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Nothing")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Nothing")!>x<!>.<!UNRESOLVED_REFERENCE!>prop_1<!>
}
@@ -60,7 +60,7 @@ fun case_7(x: Nothing) {
// TESTCASE NUMBER: 8
fun case_8(x: Nothing?) {
if (!(x is Int?)) else {
if (!(<!USELESS_IS_CHECK!>x is Int?<!>)) else {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Nothing?")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Nothing?")!>x<!>?.inv()
}
@@ -68,7 +68,7 @@ fun case_8(x: Nothing?) {
// TESTCASE NUMBER: 9
fun case_9(x: Nothing?) {
if (!!(x !is TypealiasNullableStringIndirect?)) else {
if (!!(<!USELESS_IS_CHECK!>x !is TypealiasNullableStringIndirect?<!>)) else {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Nothing?")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Nothing?")!>x<!>?.<!UNRESOLVED_REFERENCE!>length<!>
}
@@ -85,7 +85,7 @@ fun case_10(x: Nothing?) {
// TESTCASE NUMBER: 11
fun case_11(x: Nothing?) {
if (x is SealedMixedChildObject1?) {
if (<!USELESS_IS_CHECK!>x is SealedMixedChildObject1?<!>) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Nothing?")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Nothing?")!>x<!>?.<!UNRESOLVED_REFERENCE!>prop_1<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Nothing?")!>x<!>?.<!UNRESOLVED_REFERENCE!>prop_2<!>