Files
kotlin-fork/compiler/testData/diagnostics/testsWithStdLib/annotations/subclassOptInRequired/UsageOptInIsNotImplied.kt
T
2023-05-23 12:33:51 +00:00

23 lines
592 B
Kotlin
Vendored

// FIR_IDENTICAL
@RequiresOptIn
annotation class ApiMarker
@ApiMarker
class UnstableKlassApi
open class UnstableFunctionApi {
@ApiMarker
open fun overridableFunction() {}
}
@SubclassOptInRequired(ApiMarker::class)
open class NotFullyOptedIntoApiMarker: UnstableFunctionApi() {
init {
// usage is unstable, error is reported even despite SubclassOptInRequired
<!OPT_IN_USAGE_ERROR!>UnstableKlassApi<!>()
}
// usage is unstable, error is reported even despite SubclassOptInRequired
override fun <!OPT_IN_OVERRIDE_ERROR!>overridableFunction<!>() {}
}