Fix "'Redundant modality' is not reported with all-open" (KT-18195)
This commit is contained in:
@@ -279,7 +279,7 @@ fun KtDeclaration.implicitModality(): KtModifierKeywordToken {
|
|||||||
for (extension in extensions) {
|
for (extension in extensions) {
|
||||||
val newModality = extension.refineDeclarationModality(
|
val newModality = extension.refineDeclarationModality(
|
||||||
this,
|
this,
|
||||||
null,
|
descriptor as? ClassDescriptor,
|
||||||
containingDescriptor,
|
containingDescriptor,
|
||||||
mapModalityToken(predictedModality),
|
mapModalityToken(predictedModality),
|
||||||
bindingContext,
|
bindingContext,
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
<problems>
|
||||||
|
<problem>
|
||||||
|
<file>test.kt</file>
|
||||||
|
<line>4</line>
|
||||||
|
<module>light_idea_test_case</module>
|
||||||
|
<entry_point TYPE="file" FQNAME="temp:///src/test.kt" />
|
||||||
|
<problem_class severity="WARNING" attribute_key="NOT_USED_ELEMENT_ATTRIBUTES">Redundant modality modifier</problem_class>
|
||||||
|
<description>Redundant modality modifier</description>
|
||||||
|
</problem>
|
||||||
|
</problems>
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
// INSPECTION_CLASS: org.jetbrains.kotlin.idea.inspections.RedundantModalityModifierInspection
|
||||||
+4
@@ -0,0 +1,4 @@
|
|||||||
|
annotation class AllOpen
|
||||||
|
|
||||||
|
@AllOpen
|
||||||
|
open class My
|
||||||
@@ -227,6 +227,12 @@ public class InspectionTestGenerated extends AbstractInspectionTest {
|
|||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("kt18195/inspectionData/inspections.test")
|
||||||
|
public void testKt18195_inspectionData_Inspections_test() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/inspections/kt18195/inspectionData/inspections.test");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("leakingThis/inspectionData/inspections.test")
|
@TestMetadata("leakingThis/inspectionData/inspections.test")
|
||||||
public void testLeakingThis_inspectionData_Inspections_test() throws Exception {
|
public void testLeakingThis_inspectionData_Inspections_test() throws Exception {
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/inspections/leakingThis/inspectionData/inspections.test");
|
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/inspections/leakingThis/inspectionData/inspections.test");
|
||||||
|
|||||||
Reference in New Issue
Block a user