CanSealedSubClassBeObjectInspection: don't report if sub-class has classModifier

#KT-38790 Fixed
This commit is contained in:
Toshiaki Kameyama
2020-05-13 06:39:08 +09:00
committed by Yan Zhulanow
parent cea879cbd5
commit 3272b8fc2c
7 changed files with 67 additions and 2 deletions
@@ -3385,6 +3385,11 @@ public class LocalInspectionTestGenerated extends AbstractLocalInspectionTest {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("idea/testData/inspectionsLocal/convertSealedSubClassToObject"), Pattern.compile("^([\\w\\-_]+)\\.(kt|kts)$"), null, true);
}
@TestMetadata("annotation.kt")
public void testAnnotation() throws Exception {
runTest("idea/testData/inspectionsLocal/convertSealedSubClassToObject/annotation.kt");
}
@TestMetadata("baseEquals.kt")
public void testBaseEquals() throws Exception {
runTest("idea/testData/inspectionsLocal/convertSealedSubClassToObject/baseEquals.kt");
@@ -3415,6 +3420,16 @@ public class LocalInspectionTestGenerated extends AbstractLocalInspectionTest {
runTest("idea/testData/inspectionsLocal/convertSealedSubClassToObject/convertSubClassWithoutParentheses.kt");
}
@TestMetadata("data.kt")
public void testData() throws Exception {
runTest("idea/testData/inspectionsLocal/convertSealedSubClassToObject/data.kt");
}
@TestMetadata("enum.kt")
public void testEnum() throws Exception {
runTest("idea/testData/inspectionsLocal/convertSealedSubClassToObject/enum.kt");
}
@TestMetadata("fakeState.kt")
public void testFakeState() throws Exception {
runTest("idea/testData/inspectionsLocal/convertSealedSubClassToObject/fakeState.kt");
@@ -3425,6 +3440,11 @@ public class LocalInspectionTestGenerated extends AbstractLocalInspectionTest {
runTest("idea/testData/inspectionsLocal/convertSealedSubClassToObject/generic.kt");
}
@TestMetadata("inner.kt")
public void testInner() throws Exception {
runTest("idea/testData/inspectionsLocal/convertSealedSubClassToObject/inner.kt");
}
@TestMetadata("noEquals.kt")
public void testNoEquals() throws Exception {
runTest("idea/testData/inspectionsLocal/convertSealedSubClassToObject/noEquals.kt");
@@ -3450,6 +3470,11 @@ public class LocalInspectionTestGenerated extends AbstractLocalInspectionTest {
runTest("idea/testData/inspectionsLocal/convertSealedSubClassToObject/ownState.kt");
}
@TestMetadata("sealed.kt")
public void testSealed() throws Exception {
runTest("idea/testData/inspectionsLocal/convertSealedSubClassToObject/sealed.kt");
}
@TestMetadata("sealedEquals.kt")
public void testSealedEquals() throws Exception {
runTest("idea/testData/inspectionsLocal/convertSealedSubClassToObject/sealedEquals.kt");