[FE] Add test for intrinsic const evaluation in KMP annotation matching
^KT-58551
This commit is contained in:
committed by
Space Team
parent
66824435b5
commit
1dcdcee452
+6
@@ -268,6 +268,12 @@ public class FirOldFrontendMPPDiagnosticsWithLightTreeTestGenerated extends Abst
|
|||||||
runTest("compiler/testData/diagnostics/tests/multiplatform/annotationMatching/floatNumbersComparison.kt");
|
runTest("compiler/testData/diagnostics/tests/multiplatform/annotationMatching/floatNumbersComparison.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("instrinsicConstEvaluation.kt")
|
||||||
|
public void testInstrinsicConstEvaluation() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/multiplatform/annotationMatching/instrinsicConstEvaluation.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("kclassArgWithExpectClass.kt")
|
@TestMetadata("kclassArgWithExpectClass.kt")
|
||||||
public void testKclassArgWithExpectClass() throws Exception {
|
public void testKclassArgWithExpectClass() throws Exception {
|
||||||
|
|||||||
+6
@@ -268,6 +268,12 @@ public class FirOldFrontendMPPDiagnosticsWithPsiTestGenerated extends AbstractFi
|
|||||||
runTest("compiler/testData/diagnostics/tests/multiplatform/annotationMatching/floatNumbersComparison.kt");
|
runTest("compiler/testData/diagnostics/tests/multiplatform/annotationMatching/floatNumbersComparison.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("instrinsicConstEvaluation.kt")
|
||||||
|
public void testInstrinsicConstEvaluation() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/multiplatform/annotationMatching/instrinsicConstEvaluation.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("kclassArgWithExpectClass.kt")
|
@TestMetadata("kclassArgWithExpectClass.kt")
|
||||||
public void testKclassArgWithExpectClass() throws Exception {
|
public void testKclassArgWithExpectClass() throws Exception {
|
||||||
|
|||||||
+22
@@ -0,0 +1,22 @@
|
|||||||
|
// !LANGUAGE: +IntrinsicConstEvaluation
|
||||||
|
// MODULE: m1-common
|
||||||
|
// FILE: common.kt
|
||||||
|
enum class MyEnum {
|
||||||
|
FOO
|
||||||
|
}
|
||||||
|
|
||||||
|
annotation class Ann(val p: String)
|
||||||
|
|
||||||
|
@Ann("FOO")
|
||||||
|
expect fun matching()
|
||||||
|
|
||||||
|
@Ann("not FOO")
|
||||||
|
expect fun nonMatching()
|
||||||
|
|
||||||
|
// MODULE: m1-jvm()()(m1-common)
|
||||||
|
// FILE: jvm.kt
|
||||||
|
@Ann(MyEnum.FOO.name)
|
||||||
|
actual fun matching() {}
|
||||||
|
|
||||||
|
<!ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT!>@Ann(MyEnum.FOO.name)
|
||||||
|
actual fun nonMatching() {}<!>
|
||||||
Vendored
+22
@@ -0,0 +1,22 @@
|
|||||||
|
// !LANGUAGE: +IntrinsicConstEvaluation
|
||||||
|
// MODULE: m1-common
|
||||||
|
// FILE: common.kt
|
||||||
|
enum class MyEnum {
|
||||||
|
FOO
|
||||||
|
}
|
||||||
|
|
||||||
|
annotation class Ann(val p: String)
|
||||||
|
|
||||||
|
@Ann("FOO")
|
||||||
|
expect fun matching()
|
||||||
|
|
||||||
|
@Ann("not FOO")
|
||||||
|
expect fun nonMatching()
|
||||||
|
|
||||||
|
// MODULE: m1-jvm()()(m1-common)
|
||||||
|
// FILE: jvm.kt
|
||||||
|
@Ann(<!ANNOTATION_ARGUMENT_MUST_BE_CONST!>MyEnum.FOO.name<!>)
|
||||||
|
actual fun <!ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT!>matching<!>() {}
|
||||||
|
|
||||||
|
@Ann(<!ANNOTATION_ARGUMENT_MUST_BE_CONST!>MyEnum.FOO.name<!>)
|
||||||
|
actual fun <!ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT!>nonMatching<!>() {}
|
||||||
Generated
+6
@@ -22813,6 +22813,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
|
|||||||
runTest("compiler/testData/diagnostics/tests/multiplatform/annotationMatching/floatNumbersComparison.kt");
|
runTest("compiler/testData/diagnostics/tests/multiplatform/annotationMatching/floatNumbersComparison.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("instrinsicConstEvaluation.kt")
|
||||||
|
public void testInstrinsicConstEvaluation() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/multiplatform/annotationMatching/instrinsicConstEvaluation.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("kclassArgWithExpectClass.kt")
|
@TestMetadata("kclassArgWithExpectClass.kt")
|
||||||
public void testKclassArgWithExpectClass() throws Exception {
|
public void testKclassArgWithExpectClass() throws Exception {
|
||||||
|
|||||||
Reference in New Issue
Block a user