Condition of 'if' expression is constant: don't report when condition has named reference

#KT-27651 Fixed
This commit is contained in:
Toshiaki Kameyama
2020-01-27 17:06:45 +09:00
committed by Yan Zhulanow
parent bfb5efd490
commit 6ee4b5e393
3 changed files with 14 additions and 4 deletions
@@ -2480,6 +2480,11 @@ public class LocalInspectionTestGenerated extends AbstractLocalInspectionTest {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("idea/testData/inspectionsLocal/constantConditionIf"), Pattern.compile("^([\\w\\-_]+)\\.(kt|kts)$"), null, true);
}
@TestMetadata("constant.kt")
public void testConstant() throws Exception {
runTest("idea/testData/inspectionsLocal/constantConditionIf/constant.kt");
}
@TestMetadata("delete.kt")
public void testDelete() throws Exception {
runTest("idea/testData/inspectionsLocal/constantConditionIf/delete.kt");