167ab1f860
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
35 lines
486 B
Kotlin
Vendored
35 lines
486 B
Kotlin
Vendored
// !API_VERSION: 1.0
|
|
// MODULE: m1
|
|
// FILE: a.kt
|
|
|
|
package p1
|
|
|
|
@SinceKotlin("1.1")
|
|
fun foo(s: Int): String = s.toString()
|
|
|
|
// MODULE: m2
|
|
// FILE: b.kt
|
|
|
|
package p2
|
|
|
|
fun foo(s: Int): Int = s
|
|
|
|
// MODULE: m3(m1, m2)
|
|
// FILE: severalStarImports.kt
|
|
import p1.*
|
|
import p2.*
|
|
|
|
fun test1(): Int {
|
|
val r = foo(42)
|
|
return r
|
|
}
|
|
|
|
// FILE: explicitlyImportP1.kt
|
|
import p1.foo // TODO: consider reporting API_NOT_AVAILABLE here
|
|
import p2.*
|
|
|
|
fun test2(): Int {
|
|
val r = foo(42)
|
|
return r
|
|
}
|