FIR: do not inherit external modifier from super declaration
This commit is contained in:
+16
@@ -10550,6 +10550,22 @@ public class DiagnosisCompilerTestFE10TestdataTestGenerated extends AbstractDiag
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/diagnostics/tests/external")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class External {
|
||||
@Test
|
||||
public void testAllFilesPresentInExternal() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/external"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("noExternalModifierInheritance.kt")
|
||||
public void testNoExternalModifierInheritance() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/external/noExternalModifierInheritance.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/diagnostics/tests/funInterface")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
|
||||
+16
@@ -10550,6 +10550,22 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/diagnostics/tests/external")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class External {
|
||||
@Test
|
||||
public void testAllFilesPresentInExternal() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/external"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("noExternalModifierInheritance.kt")
|
||||
public void testNoExternalModifierInheritance() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/external/noExternalModifierInheritance.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/diagnostics/tests/funInterface")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
|
||||
+16
@@ -10550,6 +10550,22 @@ public class FirOldFrontendDiagnosticsWithLightTreeTestGenerated extends Abstrac
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/diagnostics/tests/external")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class External {
|
||||
@Test
|
||||
public void testAllFilesPresentInExternal() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/external"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("noExternalModifierInheritance.kt")
|
||||
public void testNoExternalModifierInheritance() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/external/noExternalModifierInheritance.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/diagnostics/tests/funInterface")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
|
||||
+1
@@ -40,6 +40,7 @@ class FirStatusResolver(
|
||||
FirDeclarationStatusImpl.Modifier.CONST,
|
||||
FirDeclarationStatusImpl.Modifier.LATEINIT,
|
||||
FirDeclarationStatusImpl.Modifier.TAILREC,
|
||||
FirDeclarationStatusImpl.Modifier.EXTERNAL,
|
||||
)
|
||||
|
||||
private val MODIFIERS_FROM_OVERRIDDEN: List<FirDeclarationStatusImpl.Modifier> =
|
||||
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// FIR_IDENTICAL
|
||||
open class A {
|
||||
open external fun foo()
|
||||
}
|
||||
|
||||
class B : A() {
|
||||
override fun foo() {
|
||||
super.foo()
|
||||
}
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package
|
||||
|
||||
public open class A {
|
||||
public constructor A()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open external fun foo(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public final class B : A {
|
||||
public constructor B()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ fun foo(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
Generated
+16
@@ -10556,6 +10556,22 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/diagnostics/tests/external")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class External {
|
||||
@Test
|
||||
public void testAllFilesPresentInExternal() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/external"), Pattern.compile("^(.*)\\.kts?$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("noExternalModifierInheritance.kt")
|
||||
public void testNoExternalModifierInheritance() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/external/noExternalModifierInheritance.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/diagnostics/tests/funInterface")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
|
||||
Reference in New Issue
Block a user