Add tests on RequireKotlin on nested classes with metadata version 1.4

This commit is contained in:
Alexander Udalov
2018-07-17 20:25:27 +02:00
parent ea3c5c0107
commit 5fbe35d1c8
13 changed files with 117 additions and 0 deletions
@@ -0,0 +1,12 @@
@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
package a
import kotlin.internal.RequireKotlin
class Outer {
@RequireKotlin("1.44")
class Nested {
@RequireKotlin("1.88")
fun f() {}
}
}
@@ -0,0 +1,7 @@
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlinInNestedClassesJs/source.kt:3:19: error: 'Nested' is only available since Kotlin 1.44 and cannot be used in Kotlin 1.2
fun test(a: Outer.Nested) {
^
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlinInNestedClassesJs/source.kt:4:7: error: 'f(): Unit' is only available since Kotlin 1.88 and cannot be used in Kotlin 1.2
a.f()
^
COMPILATION_ERROR
@@ -0,0 +1,5 @@
import a.Outer
fun test(a: Outer.Nested) {
a.f()
}