K2 opt-in: drop redundant recursive check for overridables

This commit is contained in:
Mikhail Glukhikh
2022-11-21 13:45:32 +01:00
committed by Space Team
parent cd81f22bd3
commit a77750a257
8 changed files with 105 additions and 28 deletions
@@ -0,0 +1,22 @@
@RequiresOptIn
@Target(AnnotationTarget.TYPEALIAS, AnnotationTarget.FUNCTION)
annotation class Marker
class Wrapper<T>
@Marker
typealias TA<T> = Wrapper<T>
open class Base<T> {
@Marker
open fun foo(): T? = null
open fun bar(): <!OPT_IN_USAGE_ERROR!>TA<T><!>? = null
}
class Derived : Base<String>()
fun test(d: Derived) {
d.<!OPT_IN_USAGE_ERROR!>foo<!>()
d.<!OPT_IN_USAGE_ERROR!>bar<!>()
}