IfThenToSafeAccessInspection: do not report if condition is SENSELESS_COMPARISON/USELESS_IS_CHECK (#3007)

#KT-36051 Fixed
This commit is contained in:
Toshiaki Kameyama
2020-08-19 18:22:10 +09:00
committed by GitHub
parent 122bba9102
commit d965ad0a98
7 changed files with 34 additions and 17 deletions
@@ -757,6 +757,11 @@ public class LocalInspectionTestGenerated extends AbstractLocalInspectionTest {
runTest("idea/testData/inspectionsLocal/branched/ifThenToSafeAccess/rhsNotEqualsNull.kt");
}
@TestMetadata("senselessComparison.kt")
public void testSenselessComparison() throws Exception {
runTest("idea/testData/inspectionsLocal/branched/ifThenToSafeAccess/senselessComparison.kt");
}
@TestMetadata("thenAndElseBothNull.kt")
public void testThenAndElseBothNull() throws Exception {
runTest("idea/testData/inspectionsLocal/branched/ifThenToSafeAccess/thenAndElseBothNull.kt");
@@ -787,6 +792,11 @@ public class LocalInspectionTestGenerated extends AbstractLocalInspectionTest {
runTest("idea/testData/inspectionsLocal/branched/ifThenToSafeAccess/unacceptableNoThenBlock.kt");
}
@TestMetadata("uselessIsCheck.kt")
public void testUselessIsCheck() throws Exception {
runTest("idea/testData/inspectionsLocal/branched/ifThenToSafeAccess/uselessIsCheck.kt");
}
@TestMetadata("willNotInlineClassProperty.kt")
public void testWillNotInlineClassProperty() throws Exception {
runTest("idea/testData/inspectionsLocal/branched/ifThenToSafeAccess/willNotInlineClassProperty.kt");