Fix version requirement serialization for nested classes

Use the version requierement table of the outer DescriptorSerializer
instance when serializing metadata for a class. Pass parent serializer
to DescriptorSerializer.create to make sure the correct table is used.
Serialize nested classes before the outer class in JS and common code,
to make sure requirements are not lost. Also, split
VersionRequirementTest to JVM and JS

 #KT-25120 In Progress
This commit is contained in:
Alexander Udalov
2018-07-09 20:23:21 +02:00
parent a61de052c7
commit 1e9694f1db
13 changed files with 312 additions and 134 deletions
@@ -0,0 +1,30 @@
@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
package test
import kotlin.internal.RequireKotlin
class Outer {
inner class Inner {
@RequireKotlin("1.1")
inner class Deep @RequireKotlin("1.1") constructor() {
@RequireKotlin("1.1")
fun f() {}
@RequireKotlin("1.1")
val x = ""
suspend fun s() {}
}
}
class Nested {
@RequireKotlin("1.1")
fun g() {}
}
@RequireKotlin("1.1")
companion object
}
@RequireKotlin("1.1")
fun topLevel() {}