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
45 lines
626 B
Kotlin
Vendored
45 lines
626 B
Kotlin
Vendored
// !USE_EXPERIMENTAL: kotlin.Experimental
|
|
// FILE: api.kt
|
|
|
|
package api
|
|
|
|
@Experimental(Experimental.Level.WARNING)
|
|
annotation class E
|
|
|
|
open class Base {
|
|
@E
|
|
open fun foo() {}
|
|
}
|
|
|
|
class DerivedInSameModule : Base() {
|
|
override fun <!EXPERIMENTAL_OVERRIDE!>foo<!>() {}
|
|
}
|
|
|
|
// FILE: usage-propagate.kt
|
|
|
|
package usage1
|
|
|
|
import api.*
|
|
|
|
open class Derived : Base() {
|
|
@E
|
|
override fun foo() {}
|
|
}
|
|
|
|
class SubDerived : Derived()
|
|
|
|
@E
|
|
class Derived2 : Base() {
|
|
override fun foo() {}
|
|
}
|
|
|
|
// FILE: usage-none.kt
|
|
|
|
package usage2
|
|
|
|
import api.*
|
|
|
|
class Derived : Base() {
|
|
override fun <!EXPERIMENTAL_OVERRIDE!>foo<!>() {}
|
|
}
|