Add tests on RequireKotlin on nested classes with metadata version 1.4
This commit is contained in:
Vendored
+12
@@ -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() {}
|
||||
}
|
||||
}
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlinInNestedClasses/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/requireKotlinInNestedClasses/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
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
import a.Outer
|
||||
|
||||
fun test(a: Outer.Nested) {
|
||||
a.f()
|
||||
}
|
||||
+12
@@ -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() {}
|
||||
}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlinInNestedClassesAgainst14/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/requireKotlinInNestedClassesAgainst14/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
|
||||
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlinInNestedClassesAgainst14/source.kt
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
import a.Outer
|
||||
|
||||
fun test(a: Outer.Nested) {
|
||||
a.f()
|
||||
}
|
||||
+12
@@ -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() {}
|
||||
}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
compiler/testData/compileKotlinAgainstCustomBinaries/requireKotlinInNestedClassesAgainst14Js/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/requireKotlinInNestedClassesAgainst14Js/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
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
import a.Outer
|
||||
|
||||
fun test(a: Outer.Nested) {
|
||||
a.f()
|
||||
}
|
||||
Vendored
+12
@@ -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() {}
|
||||
}
|
||||
}
|
||||
Vendored
+7
@@ -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
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
import a.Outer
|
||||
|
||||
fun test(a: Outer.Nested) {
|
||||
a.f()
|
||||
}
|
||||
+21
@@ -295,6 +295,27 @@ class CompileKotlinAgainstCustomBinariesTest : AbstractKotlinCompilerIntegration
|
||||
doTestKotlinLibraryWithWrongMetadataVersionJs("library", "-Xskip-metadata-version-check")
|
||||
}
|
||||
|
||||
fun testRequireKotlinInNestedClasses() {
|
||||
compileKotlin("source.kt", tmpdir, listOf(compileLibrary("library")))
|
||||
}
|
||||
|
||||
fun testRequireKotlinInNestedClassesJs() {
|
||||
compileKotlin("source.kt", File(tmpdir, "usage.js"), listOf(compileJsLibrary("library")), K2JSCompiler())
|
||||
}
|
||||
|
||||
fun testRequireKotlinInNestedClassesAgainst14() {
|
||||
val library = compileLibrary("library", additionalOptions = listOf("-Xmetadata-version=1.4.0"))
|
||||
compileKotlin("source.kt", tmpdir, listOf(library), additionalOptions = listOf("-Xskip-metadata-version-check"))
|
||||
}
|
||||
|
||||
fun testRequireKotlinInNestedClassesAgainst14Js() {
|
||||
val library = compileJsLibrary("library", additionalOptions = listOf("-Xmetadata-version=1.4.0"))
|
||||
compileKotlin(
|
||||
"source.kt", File(tmpdir, "usage.js"), listOf(library), K2JSCompiler(),
|
||||
additionalOptions = listOf("-Xskip-metadata-version-check")
|
||||
)
|
||||
}
|
||||
|
||||
/*test source mapping generation when source info is absent*/
|
||||
fun testInlineFunWithoutDebugInfo() {
|
||||
compileKotlin("sourceInline.kt", tmpdir)
|
||||
|
||||
Reference in New Issue
Block a user