Introduce OptionalExpectation for annotations missing on some platforms
This commits adds a new annotation OptionalExpectation to the standard library, which is experimental. To enable its usage, either pass '-Xuse-experimental=kotlin.ExperimentalMultiplatform' as a compiler argument, or '-Xuse-experimental=kotlin.Experimental' and also annotate each usage with `@UseExperimental(ExperimentalMultiplatform::class)` #KT-18882 Fixed
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
// WITH_RUNTIME
|
||||
// ADDITIONAL_COMPILER_ARGUMENTS: -Xuse-experimental=kotlin.ExperimentalMultiplatform
|
||||
|
||||
@OptionalExpectation
|
||||
expect annotation class A()
|
||||
|
||||
expect class C {
|
||||
@A
|
||||
fun f()
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
actual class C {
|
||||
actual fun f() {}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
actual annotation class A
|
||||
|
||||
actual class C {
|
||||
@A
|
||||
actual fun f() {}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
-- Common --
|
||||
Exit code: OK
|
||||
Output:
|
||||
|
||||
-- JVM --
|
||||
Exit code: OK
|
||||
Output:
|
||||
|
||||
-- JS --
|
||||
Exit code: OK
|
||||
Output:
|
||||
|
||||
Reference in New Issue
Block a user