Files
kotlin-fork/compiler/testData/diagnostics/testsWithStdLib/experimental/override.kt
T
Alexander Udalov 153c86c069 Report diagnostic on overrides of experimental members
Unless they're experimental themselves

 #KT-22759 In Progress
2018-02-08 17:07:22 +01:00

48 lines
701 B
Kotlin
Vendored

// !API_VERSION: 1.3
// MODULE: api
// FILE: api.kt
package api
@Experimental(Experimental.Level.WARNING, [Experimental.Impact.COMPILATION])
annotation class E
open class Base {
@E
open fun foo() {}
}
class DerivedInSameModule : Base() {
override fun <!EXPERIMENTAL_OVERRIDE!>foo<!>() {}
}
// MODULE: usage1(api)
// 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() {}
}
// MODULE: usage2(api)
// FILE: usage-none.kt
package usage2
import api.*
class Derived : Base() {
override fun <!EXPERIMENTAL_OVERRIDE!>foo<!>() {}
}