FE: Add two more tests around KT-59561
This commit is contained in:
committed by
Space Team
parent
9f6abfc166
commit
fd057ac68a
+12
@@ -800,6 +800,18 @@ public class FirOldFrontendMPPDiagnosticsWithLightTreeTestGenerated extends Abst
|
||||
runTest("compiler/testData/diagnostics/tests/multiplatform/annotationMatching/annotationTypeParameters.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("arrayVsOutArray.kt")
|
||||
public void testArrayVsOutArray() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/multiplatform/annotationMatching/arrayVsOutArray.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("arrayVsVararg.kt")
|
||||
public void testArrayVsVararg() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/multiplatform/annotationMatching/arrayVsVararg.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("basicOnDeclaration.kt")
|
||||
public void testBasicOnDeclaration() throws Exception {
|
||||
|
||||
+12
@@ -800,6 +800,18 @@ public class FirOldFrontendMPPDiagnosticsWithPsiTestGenerated extends AbstractFi
|
||||
runTest("compiler/testData/diagnostics/tests/multiplatform/annotationMatching/annotationTypeParameters.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("arrayVsOutArray.kt")
|
||||
public void testArrayVsOutArray() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/multiplatform/annotationMatching/arrayVsOutArray.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("arrayVsVararg.kt")
|
||||
public void testArrayVsVararg() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/multiplatform/annotationMatching/arrayVsVararg.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("basicOnDeclaration.kt")
|
||||
public void testBasicOnDeclaration() throws Exception {
|
||||
|
||||
Vendored
+20
@@ -0,0 +1,20 @@
|
||||
// MODULE: m1-common
|
||||
// FILE: common.kt
|
||||
|
||||
expect annotation class A(val x: Array<out String>)
|
||||
|
||||
@A("abc", <!TOO_MANY_ARGUMENTS!>"foo"<!>, <!TOO_MANY_ARGUMENTS!>"bar"<!>)
|
||||
fun test() {}
|
||||
|
||||
// MODULE: m1-jvm()()(m1-common)
|
||||
// FILE: jvm.kt
|
||||
|
||||
actual annotation class A(val x: Array<String>)
|
||||
|
||||
@A("abc", <!TOO_MANY_ARGUMENTS!>"foo"<!>, <!TOO_MANY_ARGUMENTS!>"bar"<!>)
|
||||
fun test2() {}
|
||||
|
||||
annotation class B(val x: Array<out String>)
|
||||
|
||||
@B("abc", <!TOO_MANY_ARGUMENTS!>"foo"<!>, <!TOO_MANY_ARGUMENTS!>"bar"<!>)
|
||||
fun test3() {}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
// MODULE: m1-common
|
||||
// FILE: common.kt
|
||||
|
||||
expect annotation class A(val x: Array<out String>)
|
||||
|
||||
@A(<!TYPE_MISMATCH, TYPE_MISMATCH{JVM}!>"abc"<!>, <!TOO_MANY_ARGUMENTS, TOO_MANY_ARGUMENTS{JVM}!>"foo"<!>, <!TOO_MANY_ARGUMENTS, TOO_MANY_ARGUMENTS{JVM}!>"bar"<!>)
|
||||
fun test() {}
|
||||
|
||||
// MODULE: m1-jvm()()(m1-common)
|
||||
// FILE: jvm.kt
|
||||
|
||||
actual annotation class <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>A<!>(val x: Array<String>)
|
||||
|
||||
@A(<!TYPE_MISMATCH!>"abc"<!>, <!TOO_MANY_ARGUMENTS!>"foo"<!>, <!TOO_MANY_ARGUMENTS!>"bar"<!>)
|
||||
fun test2() {}
|
||||
|
||||
annotation class B(val x: Array<out String>)
|
||||
|
||||
@B(<!TYPE_MISMATCH!>"abc"<!>, <!TOO_MANY_ARGUMENTS!>"foo"<!>, <!TOO_MANY_ARGUMENTS!>"bar"<!>)
|
||||
fun test3() {}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
// MODULE: m1-common
|
||||
// FILE: common.kt
|
||||
|
||||
<!INCOMPATIBLE_MATCHING{JVM}("A; A; some expected members have no actual ones")!>expect annotation class A<!INCOMPATIBLE_MATCHING{JVM}("<init>; <init>; some value parameter is vararg in one declaration and non-vararg in the other")!>(vararg val x: String)<!><!>
|
||||
|
||||
@A("abc", "foo", "bar")
|
||||
fun test() {}
|
||||
|
||||
// MODULE: m1-jvm()()(m1-common)
|
||||
// FILE: jvm.kt
|
||||
|
||||
actual annotation class A(val x: Array<String>)
|
||||
|
||||
@A("abc", <!TOO_MANY_ARGUMENTS!>"foo"<!>, <!TOO_MANY_ARGUMENTS!>"bar"<!>)
|
||||
fun test2() {}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
// MODULE: m1-common
|
||||
// FILE: common.kt
|
||||
|
||||
expect annotation class A(vararg val x: String)
|
||||
|
||||
@A(<!TYPE_MISMATCH{JVM}!>"abc"<!>, <!TOO_MANY_ARGUMENTS{JVM}!>"foo"<!>, <!TOO_MANY_ARGUMENTS{JVM}!>"bar"<!>)
|
||||
fun test() {}
|
||||
|
||||
// MODULE: m1-jvm()()(m1-common)
|
||||
// FILE: jvm.kt
|
||||
|
||||
actual annotation class <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>A<!>(val x: Array<String>)
|
||||
|
||||
@A(<!TYPE_MISMATCH!>"abc"<!>, <!TOO_MANY_ARGUMENTS!>"foo"<!>, <!TOO_MANY_ARGUMENTS!>"bar"<!>)
|
||||
fun test2() {}
|
||||
Generated
+12
@@ -23975,6 +23975,18 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
|
||||
runTest("compiler/testData/diagnostics/tests/multiplatform/annotationMatching/annotationTypeParameters.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("arrayVsOutArray.kt")
|
||||
public void testArrayVsOutArray() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/multiplatform/annotationMatching/arrayVsOutArray.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("arrayVsVararg.kt")
|
||||
public void testArrayVsVararg() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/multiplatform/annotationMatching/arrayVsVararg.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("basicOnDeclaration.kt")
|
||||
public void testBasicOnDeclaration() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user