7d3368da58
Related to KT-41886
37 lines
787 B
Kotlin
Vendored
37 lines
787 B
Kotlin
Vendored
// FIR_IDENTICAL
|
|
@RequiresOptIn
|
|
annotation class Marker
|
|
|
|
@SubclassOptInRequired(Marker::class)
|
|
open class Base
|
|
|
|
@Marker
|
|
class DerivedFirst : Base()
|
|
|
|
@OptIn(Marker::class)
|
|
class DerivedSecond : Base()
|
|
|
|
@SubclassOptInRequired(Marker::class)
|
|
open class DerivedThird : Base()
|
|
|
|
open class DerivedFourth : <!OPT_IN_USAGE_ERROR!>Base<!>()
|
|
|
|
class GrandDerivedThird : <!OPT_IN_USAGE_ERROR!>DerivedThird<!>()
|
|
|
|
// Question: should we have an error also here?
|
|
class GrandDerivedFourth : DerivedFourth()
|
|
|
|
@Marker
|
|
open class Marked
|
|
|
|
@SubclassOptInRequired(Marker::class)
|
|
class DerivedMarked : <!OPT_IN_USAGE_ERROR!>Marked<!>()
|
|
|
|
fun test() {
|
|
val b = Base()
|
|
val d1 = <!OPT_IN_USAGE_ERROR!>DerivedFirst<!>()
|
|
val d2 = DerivedSecond()
|
|
val d3 = DerivedThird()
|
|
val d4 = DerivedFourth()
|
|
}
|