mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-17 15:54:03 +00:00
For example, if a class is `@SinceKotlin("X")
@WasExperimental(M::class)`, then its constructor should also be
accessible if API < X, provided that the opt-in to M is given
24 lines
661 B
Kotlin
Vendored
24 lines
661 B
Kotlin
Vendored
// !API_VERSION: 1.0
|
|
|
|
@SinceKotlin("1.1")
|
|
open class Foo
|
|
|
|
class Bar @SinceKotlin("1.1") constructor()
|
|
|
|
@SinceKotlin("1.0")
|
|
class Baz @SinceKotlin("1.1") constructor()
|
|
|
|
@SinceKotlin("1.1")
|
|
class Quux @SinceKotlin("1.0") constructor()
|
|
|
|
fun t1(): <!API_NOT_AVAILABLE!>Foo<!> = <!UNRESOLVED_REFERENCE!>Foo<!>()
|
|
|
|
// TODO: do not report API_NOT_AVAILABLE twice
|
|
fun t2() = object : <!UNRESOLVED_REFERENCE, API_NOT_AVAILABLE, API_NOT_AVAILABLE, DEBUG_INFO_UNRESOLVED_WITH_TARGET!>Foo<!>() {}
|
|
|
|
fun t3(): Bar? = <!UNRESOLVED_REFERENCE!>Bar<!>()
|
|
|
|
fun t4(): Baz = <!UNRESOLVED_REFERENCE!>Baz<!>()
|
|
|
|
fun t5(): <!API_NOT_AVAILABLE!>Quux<!> = <!UNRESOLVED_REFERENCE!>Quux<!>()
|