ad9025afa6
At the moment, SubclassOptInRequired is marked with the ExperimentalSubclassOptIn annotation. However, it does not work as expected due to a missing opt-in error. To use SubclassOptInRequired, an explicit opt-in is necessary because SubclassOptInRequired is an unstable feature now. ^KT-64739
20 lines
467 B
Kotlin
Vendored
20 lines
467 B
Kotlin
Vendored
// FIR_IDENTICAL
|
|
@file:OptIn(ExperimentalSubclassOptIn::class)
|
|
|
|
@RequiresOptIn
|
|
annotation class ApiMarker
|
|
|
|
@ApiMarker
|
|
interface I1
|
|
|
|
@SubclassOptInRequired(ApiMarker::class)
|
|
interface I2
|
|
|
|
// SubclassOptInRequired can only fix the error from I2
|
|
@SubclassOptInRequired(ApiMarker::class)
|
|
interface Impl1: <!OPT_IN_USAGE_ERROR!>I1<!>, I2
|
|
|
|
// the order of I1 and I2 shouldn't matter
|
|
@SubclassOptInRequired(ApiMarker::class)
|
|
interface Impl2: I2, <!OPT_IN_USAGE_ERROR!>I1<!>
|