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:
+19
@@ -0,0 +1,19 @@
|
||||
// !API_VERSION: 1.0
|
||||
|
||||
@SinceKotlin("1.1")
|
||||
fun f() {}
|
||||
|
||||
@SinceKotlin("1.1")
|
||||
var p = Unit
|
||||
|
||||
@SinceKotlin("1.1.2")
|
||||
fun z() {}
|
||||
|
||||
|
||||
fun t1() = <!UNRESOLVED_REFERENCE!>f<!>()
|
||||
|
||||
fun t2() = <!UNRESOLVED_REFERENCE!>p<!>
|
||||
|
||||
fun t3() { <!UNRESOLVED_REFERENCE!>p<!> = Unit }
|
||||
|
||||
fun t4() { <!UNRESOLVED_REFERENCE!>z<!>() }
|
||||
Reference in New Issue
Block a user