Files
kotlin-fork/compiler/testData/diagnostics/testsWithStdLib/experimental/errors.kt
T
2021-09-29 19:39:25 +03:00

29 lines
393 B
Kotlin
Vendored

// FIR_IDENTICAL
// !OPT_IN: 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 <!OPT_IN_OVERRIDE_ERROR!>foo<!>() {}
}
fun test(b: Base) {
b.<!OPT_IN_USAGE_ERROR!>foo<!>()
}