Files
kotlin-fork/compiler/testData/diagnostics/tests/sourceCompatibility/apiVersion/classesAndConstructors.fir.kt
T
Dmitrii Gridin 9a267176f5 [FIR] move deprecation calculation to COMPILER_REQUIRED_ANNOTATIONS phase
Also, this change adds SinceKotlin and Java.Deprecated to this phase
It fixes some problems with API_NOT_AVAILABLE, so now it is closer to K1

^KT-57648 Fixed
^KT-55723 Fixed
2023-05-11 10:31:52 +00:00

24 lines
579 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<!> = <!API_NOT_AVAILABLE!>Foo<!>()
// TODO: do not report API_NOT_AVAILABLE twice
fun t2() = object : <!API_NOT_AVAILABLE!>Foo<!>() {}
fun t3(): Bar? = <!UNRESOLVED_REFERENCE!>Bar<!>()
fun t4(): Baz = <!UNRESOLVED_REFERENCE!>Baz<!>()
fun t5(): <!API_NOT_AVAILABLE!>Quux<!> = <!API_NOT_AVAILABLE!>Quux<!>()