Fix type table serialization in DescriptorSerializer

Always serialize type table (and version requirement table) after
everything else, to prevent bugs like KT-51446 where inline class
underlying type was added to the type table after it has already been
serialized.

 #KT-51446 Fixed
This commit is contained in:
Alexander Udalov
2022-02-22 21:58:19 +01:00
parent c53d91bae1
commit b443848ea0
11 changed files with 78 additions and 54 deletions
@@ -0,0 +1,18 @@
// !LANGUAGE: +GenericInlineClassParameter
// WITH_STDLIB
// USE_TYPE_TABLE
// MODULE: lib
// FILE: A.kt
inline class A<T> private constructor(private val value: T) {
val publicValue: String get() = value.toString()
companion object {
fun create(c: Char): A<String> = A(c + "K")
}
}
// MODULE: main(lib)
// FILE: B.kt
fun box(): String = A.create('O').publicValue