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:
+8
@@ -83,3 +83,11 @@ This directive lets you enable or disable certain language features. Language fe
|
||||
// !LANGUAGE: -TopLevelSealedInheritance
|
||||
|
||||
// !LANGUAGE: +TypeAliases -LocalDelegatedProperties
|
||||
|
||||
### 5. API_VERSION
|
||||
|
||||
This directive emulates the behavior of the `-api-version` command line option, disallowing to use declarations annotated with `@SinceKotlin(X)` where X is greater than the specified API version.
|
||||
|
||||
#### Usage:
|
||||
|
||||
// !API_VERSION: 1.0
|
||||
|
||||
Reference in New Issue
Block a user