Files
kotlin-fork/compiler/testData/diagnostics/testsWithStdLib/experimental/overridableCheck.kt
T
2022-11-23 12:00:06 +00:00

23 lines
416 B
Kotlin
Vendored

@RequiresOptIn
@Target(AnnotationTarget.TYPEALIAS, AnnotationTarget.FUNCTION)
annotation class Marker
class Wrapper<T>
@Marker
typealias TA<T> = Wrapper<T>
open class Base<T> {
@Marker
open fun foo(): T? = null
open fun bar(): <!OPT_IN_USAGE_ERROR!>TA<!><T>? = null
}
class Derived : Base<String>()
fun test(d: Derived) {
d.<!OPT_IN_USAGE_ERROR!>foo<!>()
d.<!OPT_IN_USAGE_ERROR!>bar<!>()
}