Introduce "-api-version" CLI option
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
This commit is contained in:
+48
@@ -0,0 +1,48 @@
|
||||
// !API_VERSION: 1.0
|
||||
|
||||
val v1: String
|
||||
@SinceKotlin("1.1")
|
||||
get() = ""
|
||||
|
||||
@SinceKotlin("1.1")
|
||||
val v2 = ""
|
||||
|
||||
var v3: String
|
||||
@SinceKotlin("1.1")
|
||||
get() = ""
|
||||
set(value) {}
|
||||
|
||||
var v4: String
|
||||
get() = ""
|
||||
@SinceKotlin("1.1")
|
||||
set(value) {}
|
||||
|
||||
var v5: String
|
||||
@SinceKotlin("1.1")
|
||||
get() = ""
|
||||
@SinceKotlin("1.1")
|
||||
set(value) {}
|
||||
|
||||
@SinceKotlin("1.1")
|
||||
var v6: String
|
||||
get() = ""
|
||||
set(value) {}
|
||||
|
||||
@SinceKotlin("1.0")
|
||||
val v7: String
|
||||
@SinceKotlin("1.1")
|
||||
get() = ""
|
||||
|
||||
fun test() {
|
||||
<!API_NOT_AVAILABLE!>v1<!>
|
||||
<!UNRESOLVED_REFERENCE!>v2<!>
|
||||
<!API_NOT_AVAILABLE!>v3<!>
|
||||
v3 = ""
|
||||
v4
|
||||
<!API_NOT_AVAILABLE!>v4<!> = ""
|
||||
<!API_NOT_AVAILABLE!>v5<!>
|
||||
<!API_NOT_AVAILABLE!>v5<!> = ""
|
||||
<!UNRESOLVED_REFERENCE!>v6<!>
|
||||
<!UNRESOLVED_REFERENCE!>v6<!> = ""
|
||||
<!API_NOT_AVAILABLE!>v7<!>
|
||||
}
|
||||
Reference in New Issue
Block a user