Files
kotlin-fork/compiler/testData/diagnostics/testsWithStdLib/experimental/errors.kt
T
2021-06-08 11:37:27 +03:00

28 lines
402 B
Kotlin
Vendored

// !USE_EXPERIMENTAL: kotlin.RequiresOptIn
// FILE: api.kt
package api
@RequiresOptIn
@Retention(AnnotationRetention.BINARY)
annotation class E
open class Base {
@E
open fun foo() {}
}
// FILE: usage.kt
package usage
import api.*
class Derived : Base() {
override fun <!EXPERIMENTAL_OVERRIDE_ERROR!>foo<!>() {}
}
fun test(b: Base) {
b.<!EXPERIMENTAL_API_USAGE_ERROR!>foo<!>()
}