K2: report errors related to SubClassOptInRequired annotation
Related to KT-41886
This commit is contained in:
committed by
teamcity
parent
c67c5cad27
commit
7d3368da58
-35
@@ -1,35 +0,0 @@
|
||||
@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 : Base()
|
||||
|
||||
class GrandDerivedThird : 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()
|
||||
}
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
@RequiresOptIn
|
||||
annotation class Marker
|
||||
|
||||
|
||||
Reference in New Issue
Block a user