Add tests for repeatable annotations on expect-actual declarations
Add tests showing current behavior. ^KT-60670
This commit is contained in:
committed by
Space Team
parent
2de9480101
commit
5ed3f308fa
+12
@@ -292,6 +292,18 @@ public class FirOldFrontendMPPDiagnosticsWithLightTreeTestGenerated extends Abst
|
||||
runTest("compiler/testData/diagnostics/tests/multiplatform/annotationMatching/kotlinAnaloguesForJavaAnnotations.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("repeatableNoArg.kt")
|
||||
public void testRepeatableNoArg() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/multiplatform/annotationMatching/repeatableNoArg.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("repeatableWithArg.kt")
|
||||
public void testRepeatableWithArg() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/multiplatform/annotationMatching/repeatableWithArg.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("skippedAnnotations.kt")
|
||||
public void testSkippedAnnotations() throws Exception {
|
||||
|
||||
+12
@@ -292,6 +292,18 @@ public class FirOldFrontendMPPDiagnosticsWithPsiTestGenerated extends AbstractFi
|
||||
runTest("compiler/testData/diagnostics/tests/multiplatform/annotationMatching/kotlinAnaloguesForJavaAnnotations.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("repeatableNoArg.kt")
|
||||
public void testRepeatableNoArg() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/multiplatform/annotationMatching/repeatableNoArg.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("repeatableWithArg.kt")
|
||||
public void testRepeatableWithArg() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/multiplatform/annotationMatching/repeatableWithArg.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("skippedAnnotations.kt")
|
||||
public void testSkippedAnnotations() throws Exception {
|
||||
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
// FIR_IDENTICAL
|
||||
// WITH_STDLIB
|
||||
// MODULE: m1-common
|
||||
// FILE: common.kt
|
||||
@Repeatable
|
||||
annotation class AnnNoArg
|
||||
|
||||
@AnnNoArg
|
||||
@AnnNoArg
|
||||
expect fun oneMoreOnExpect()
|
||||
|
||||
@AnnNoArg
|
||||
expect fun oneMoreOnActual()
|
||||
|
||||
// MODULE: m1-jvm()()(m1-common)
|
||||
// FILE: jvm.kt
|
||||
|
||||
@AnnNoArg
|
||||
actual fun oneMoreOnExpect() {}
|
||||
|
||||
@AnnNoArg
|
||||
@AnnNoArg
|
||||
actual fun oneMoreOnActual() {}
|
||||
Vendored
+40
@@ -0,0 +1,40 @@
|
||||
// WITH_STDLIB
|
||||
// MODULE: m1-common
|
||||
// FILE: common.kt
|
||||
@Repeatable
|
||||
annotation class AnnWithArg(val s: String)
|
||||
|
||||
@AnnWithArg(s = "1")
|
||||
@AnnWithArg(s = "2")
|
||||
expect fun diffentOrder()
|
||||
|
||||
@AnnWithArg(s = "1")
|
||||
@AnnWithArg(s = "2")
|
||||
@AnnWithArg(s = "3")
|
||||
expect fun withDifferentArgLessOnActual()
|
||||
|
||||
@AnnWithArg(s = "1")
|
||||
@AnnWithArg(s = "3")
|
||||
expect fun withDifferentArgLessOnExpect()
|
||||
|
||||
@AnnWithArg(s = "1")
|
||||
@AnnWithArg(s = "1")
|
||||
expect fun withSameArgLessOnActual()
|
||||
|
||||
// MODULE: m1-jvm()()(m1-common)
|
||||
// FILE: jvm.kt
|
||||
@AnnWithArg(s = "1")
|
||||
@AnnWithArg(s = "2")
|
||||
actual fun diffentOrder() {}
|
||||
|
||||
<!ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT!>@AnnWithArg(s = "1")
|
||||
@AnnWithArg(s = "3")
|
||||
actual fun <!ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT!>withDifferentArgLessOnActual<!>() {}<!>
|
||||
|
||||
@AnnWithArg(s = "1")
|
||||
@AnnWithArg(s = "2")
|
||||
@AnnWithArg(s = "3")
|
||||
actual fun withDifferentArgLessOnExpect() {}
|
||||
|
||||
@AnnWithArg(s = "1")
|
||||
actual fun withSameArgLessOnActual() {}
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
// WITH_STDLIB
|
||||
// MODULE: m1-common
|
||||
// FILE: common.kt
|
||||
@Repeatable
|
||||
annotation class AnnWithArg(val s: String)
|
||||
|
||||
@AnnWithArg(s = "1")
|
||||
@AnnWithArg(s = "2")
|
||||
expect fun diffentOrder()
|
||||
|
||||
@AnnWithArg(s = "1")
|
||||
@AnnWithArg(s = "2")
|
||||
@AnnWithArg(s = "3")
|
||||
expect fun withDifferentArgLessOnActual()
|
||||
|
||||
@AnnWithArg(s = "1")
|
||||
@AnnWithArg(s = "3")
|
||||
expect fun withDifferentArgLessOnExpect()
|
||||
|
||||
@AnnWithArg(s = "1")
|
||||
@AnnWithArg(s = "1")
|
||||
expect fun withSameArgLessOnActual()
|
||||
|
||||
// MODULE: m1-jvm()()(m1-common)
|
||||
// FILE: jvm.kt
|
||||
@AnnWithArg(s = "1")
|
||||
@AnnWithArg(s = "2")
|
||||
actual fun diffentOrder() {}
|
||||
|
||||
@AnnWithArg(s = "1")
|
||||
@AnnWithArg(s = "3")
|
||||
actual fun <!ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT!>withDifferentArgLessOnActual<!>() {}
|
||||
|
||||
@AnnWithArg(s = "1")
|
||||
@AnnWithArg(s = "2")
|
||||
@AnnWithArg(s = "3")
|
||||
actual fun withDifferentArgLessOnExpect() {}
|
||||
|
||||
@AnnWithArg(s = "1")
|
||||
actual fun withSameArgLessOnActual() {}
|
||||
Generated
+12
@@ -22935,6 +22935,18 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
|
||||
runTest("compiler/testData/diagnostics/tests/multiplatform/annotationMatching/kotlinAnaloguesForJavaAnnotations.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("repeatableNoArg.kt")
|
||||
public void testRepeatableNoArg() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/multiplatform/annotationMatching/repeatableNoArg.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("repeatableWithArg.kt")
|
||||
public void testRepeatableWithArg() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/multiplatform/annotationMatching/repeatableWithArg.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("skippedAnnotations.kt")
|
||||
public void testSkippedAnnotations() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user