Files
kotlin-fork/compiler/testData/diagnostics/testsWithStdLib/experimental/overrideDifferentExperimentalities.kt
T
Alexander Udalov c57864e46c Require "-Xuse-experimental=kotlin.Experimental" on usages of Experimental
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
2018-05-04 13:48:24 +02:00

36 lines
588 B
Kotlin
Vendored

// !USE_EXPERIMENTAL: kotlin.Experimental
@Experimental(Experimental.Level.WARNING)
annotation class E1
@Experimental(Experimental.Level.WARNING)
annotation class E3
interface Base1 {
@E1
fun foo()
}
interface Base2 {
fun foo()
}
interface Base3 {
@E3
fun foo()
}
class DerivedA : Base1, Base2, Base3 {
override fun <!EXPERIMENTAL_OVERRIDE, EXPERIMENTAL_OVERRIDE!>foo<!>() {}
}
class DerivedB : Base1, Base3 {
@E3
override fun <!EXPERIMENTAL_OVERRIDE!>foo<!>() {}
}
class DerivedC : Base1, Base2, Base3 {
@E1
@E3
override fun foo() {}
}