Make $serializer generic constructor public
If a serializable class has generic type parameters, its serializer is not an object and has a specialized constructor. This constructor was public in K1 and should be public in K2 so it can be called from other serializable classes (in case class is e.g., part of sealed hierarchy). #KT-63402 Fixed
This commit is contained in:
committed by
Space Team
parent
51e3e9af94
commit
662bff7351
@@ -0,0 +1,28 @@
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
|
||||
// WITH_STDLIB
|
||||
|
||||
// FILE: a.kt
|
||||
|
||||
import kotlinx.serialization.*
|
||||
|
||||
@Serializable
|
||||
sealed class Base {
|
||||
abstract val id: Long
|
||||
}
|
||||
|
||||
// FILE: b.kt
|
||||
|
||||
import kotlinx.serialization.*
|
||||
import kotlinx.serialization.descriptors.*
|
||||
|
||||
@Serializable
|
||||
class DerivedOtherFile<Value>(
|
||||
override val id: Long,
|
||||
val value: Value
|
||||
) : Base()
|
||||
|
||||
fun box(): String {
|
||||
val desc = Base.serializer().descriptor.kind
|
||||
return if (desc == PolymorphicKind.SEALED) "OK" else desc.toString()
|
||||
}
|
||||
Reference in New Issue
Block a user