mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-18 00:21:35 +00:00
Experimental and UseExperimental can only be used as annotations or qualifiers (to allow "Experimental.Level.*"); experimental markers can only be used as annotations or qualifiers, or as left-hand side of a ::class literal in arguments to UseExperimental/WasExperimental. This is needed because we're not yet sure of the design of this feature and would like to retain the possibility to drop these declarations (Experimental, UseExperimental) altogether. If they were going to be used as types, it would be problematic because we can't simply delete something from stdlib, should deprecate it first. With this change, these declarations can only be used if the user has opted into using the experimental API somehow (for example, with `-Xuse-experimental=kotlin.Experimental`), so we won't stop conforming to our deprecation policy if we decide to remove these declarations in the future
10 lines
237 B
Kotlin
Vendored
10 lines
237 B
Kotlin
Vendored
// !USE_EXPERIMENTAL: kotlin.Experimental
|
|
|
|
annotation class NotAMarker
|
|
|
|
<!USE_EXPERIMENTAL_WITHOUT_ARGUMENTS!>@UseExperimental<!>
|
|
fun f1() {}
|
|
|
|
<!USE_EXPERIMENTAL_ARGUMENT_IS_NOT_MARKER!>@UseExperimental(NotAMarker::class)<!>
|
|
fun f2() {}
|