mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +00:00
The `@SinceKotlin("X.Y.Z")` annotation now hides a particular declaration from
resolution when the API version specified by the `-api-version` option is
_less_ than X.Y.Z. The comparison is performed as for versions in Maven:
MavenComparableVersion is in fact a copy of
org.apache.maven.artifact.versioning.ComparableVersion.
Also support "!API_VERSION" directive in diagnostic tests
#KT-14298 Fixed
20 lines
520 B
Kotlin
Vendored
20 lines
520 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()
|
|
|
|
|
|
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<!>()
|