Support multiple version requirements on single element

This commit is contained in:
Alexander Udalov
2018-07-19 15:11:30 +02:00
parent b7df36643b
commit c011bf61fe
22 changed files with 1681 additions and 601 deletions
@@ -0,0 +1,27 @@
@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
package a
import kotlin.internal.RequireKotlin as RK
import kotlin.internal.RequireKotlinVersionKind as K
@RK("42.33", message = "This declaration is only supported since Kotlin 42.33")
@RK("40.34", versionKind = K.API_VERSION)
@RK("45.35")
class A
@RK("42.33", message = "This declaration is only supported since Kotlin 42.33")
@RK("40.34", versionKind = K.API_VERSION)
@RK("45.35")
@RK("1.1")
fun f() {}
@RK("42.33", message = "This declaration is only supported since Kotlin 42.33")
@RK("40.34", versionKind = K.API_VERSION)
@RK("45.35")
val p = ""
@RK("42.33", message = "This declaration is only supported since Kotlin 42.33")
@RK("40.34", versionKind = K.API_VERSION)
@RK("45.35")
@RK("1.1")
typealias TA = String
@@ -0,0 +1,37 @@
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:3:13: error: 'A' is only available since Kotlin 42.33 and cannot be used in Kotlin 1.2. This declaration is only supported since Kotlin 42.33
fun test(a: A): TA {
^
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:3:13: error: 'A' is only available since Kotlin 40.34 and cannot be used in Kotlin 1.2
fun test(a: A): TA {
^
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:3:13: error: 'A' is only available since Kotlin 45.35 and cannot be used in Kotlin 1.2
fun test(a: A): TA {
^
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:3:17: error: 'typealias TA = String' is only available since Kotlin 42.33 and cannot be used in Kotlin 1.2. This declaration is only supported since Kotlin 42.33
fun test(a: A): TA {
^
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:3:17: error: 'typealias TA = String' is only available since Kotlin 40.34 and cannot be used in Kotlin 1.2
fun test(a: A): TA {
^
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:3:17: error: 'typealias TA = String' is only available since Kotlin 45.35 and cannot be used in Kotlin 1.2
fun test(a: A): TA {
^
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:4:5: error: 'f(): Unit' is only available since Kotlin 42.33 and cannot be used in Kotlin 1.2. This declaration is only supported since Kotlin 42.33
f()
^
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:4:5: error: 'f(): Unit' is only available since Kotlin 40.34 and cannot be used in Kotlin 1.2
f()
^
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:4:5: error: 'f(): Unit' is only available since Kotlin 45.35 and cannot be used in Kotlin 1.2
f()
^
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:5:12: error: 'p: String' is only available since Kotlin 42.33 and cannot be used in Kotlin 1.2. This declaration is only supported since Kotlin 42.33
return p
^
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:5:12: error: 'p: String' is only available since Kotlin 40.34 and cannot be used in Kotlin 1.2
return p
^
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlin/source.kt:5:12: error: 'p: String' is only available since Kotlin 45.35 and cannot be used in Kotlin 1.2
return p
^
COMPILATION_ERROR
@@ -0,0 +1,6 @@
import a.*
fun test(a: A): TA {
f()
return p
}