[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
+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<!>() {}
|
||||
Reference in New Issue
Block a user