K2 opt-in: drop redundant recursive check for overridables
This commit is contained in:
committed by
Space Team
parent
cd81f22bd3
commit
a77750a257
+22
@@ -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<!>()
|
||||
}
|
||||
Reference in New Issue
Block a user