c57864e46c
Since we're not yet sure of the design of Experimental/UseExperimental, we're making them "experimental" themselves in some sense, in that the user is required to provide the magic argument "-Xuse-experimental=kotlin.Experimental" to be allowed to use either Experimental or UseExperimental. This is more convenient than the previous approach of "-language-version 1.3 -Xskip-metadata-version-check" because it's simpler and does not cause pre-release binaries to be produced
24 lines
309 B
Kotlin
Vendored
24 lines
309 B
Kotlin
Vendored
// FILE: api.kt
|
|
|
|
@<!EXPERIMENTAL_IS_NOT_ENABLED!>Experimental<!>
|
|
annotation class Marker
|
|
|
|
@Marker
|
|
fun f() {}
|
|
|
|
// FILE: usage.kt
|
|
|
|
fun use1() {
|
|
<!EXPERIMENTAL_API_USAGE_ERROR!>f<!>()
|
|
}
|
|
|
|
@Marker
|
|
fun use2() {
|
|
f()
|
|
}
|
|
|
|
@<!EXPERIMENTAL_IS_NOT_ENABLED!>UseExperimental<!>(Marker::class)
|
|
fun use3() {
|
|
f()
|
|
}
|