Add/fix extra cases for #KT-41886 Fixed

This commit is contained in:
Mikhail Glukhikh
2022-07-12 16:12:45 +02:00
committed by teamcity
parent 7d3368da58
commit 76aaecbdf0
3 changed files with 56 additions and 3 deletions
@@ -25,7 +25,7 @@ class GrandDerivedFourth : DerivedFourth()
open class Marked
@SubclassOptInRequired(Marker::class)
class DerivedMarked : <!OPT_IN_USAGE_ERROR!>Marked<!>()
open class DerivedMarked : <!OPT_IN_USAGE_ERROR!>Marked<!>()
fun test() {
val b = Base()
@@ -34,3 +34,18 @@ fun test() {
val d3 = DerivedThird()
val d4 = DerivedFourth()
}
fun test2(b: Base, g: Generic<Base>) {
object : <!OPT_IN_USAGE_ERROR!>Base<!>() {}
}
open class Generic<T>
class DerivedGeneric : Generic<Base>()
@SubclassOptInRequired(Marker::class)
interface BaseInterface
interface DerivedInterface : <!OPT_IN_USAGE_ERROR!>BaseInterface<!>
class Delegated(val bi: BaseInterface) : <!OPT_IN_USAGE_ERROR!>BaseInterface<!> by bi