[FE] Prohibit expect or actual opt-in annotations

^KT-58554
This commit is contained in:
Roman Efremov
2023-07-04 16:35:36 +02:00
committed by Space Team
parent 600bb3dbc7
commit 4a598afc36
17 changed files with 125 additions and 0 deletions
@@ -0,0 +1,23 @@
// WITH_STDLIB
// MODULE: m1-common
// FILE: common.kt
expect annotation class ActualOnly
@RequiresOptIn
<!EXPECT_ACTUAL_OPT_IN_ANNOTATION!>expect<!> annotation class Both
@OptIn(ExperimentalMultiplatform::class)
@RequiresOptIn
@OptionalExpectation
expect annotation class MyOptIn
// MODULE: m1-jvm()()(m1-common)
// FILE: jvm.kt
@RequiresOptIn
<!EXPECT_ACTUAL_OPT_IN_ANNOTATION!>actual<!> annotation class ActualOnly
@RequiresOptIn
<!EXPECT_ACTUAL_OPT_IN_ANNOTATION!>actual<!> annotation class Both
@RequiresOptIn
actual annotation class MyOptIn
@@ -0,0 +1,23 @@
// WITH_STDLIB
// MODULE: m1-common
// FILE: common.kt
expect annotation class ActualOnly
@RequiresOptIn
<!EXPECT_ACTUAL_OPT_IN_ANNOTATION{JVM}!>expect<!> annotation class Both
@OptIn(ExperimentalMultiplatform::class)
@RequiresOptIn
@OptionalExpectation
expect annotation class MyOptIn
// MODULE: m1-jvm()()(m1-common)
// FILE: jvm.kt
@RequiresOptIn
<!EXPECT_ACTUAL_OPT_IN_ANNOTATION!>actual<!> annotation class ActualOnly
@RequiresOptIn
<!EXPECT_ACTUAL_OPT_IN_ANNOTATION!>actual<!> annotation class Both
@RequiresOptIn
actual annotation class MyOptIn