[KxSerialization] Added inspections on custom serializer parameters
Added inspections to check: - custom serializer on class has as many parameters in primary constructor as the serializable class of type arguments - all parameters in custom serializer has `KSerializer` type - property in serializable class not parametrized by type parameter - custom serializer on property of serializable class have no parameters in primary constructor
This commit is contained in:
committed by
Space Team
parent
9532172a22
commit
84ad12be57
@@ -0,0 +1,18 @@
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
|
||||
// WITH_STDLIB
|
||||
|
||||
import kotlinx.serialization.*
|
||||
|
||||
@Serializable(with = PolymorphicSerializer::class)
|
||||
interface ExplicitlyPolymorphic
|
||||
|
||||
@Serializable
|
||||
class Holder(
|
||||
val poly: ExplicitlyPolymorphic
|
||||
)
|
||||
fun box(): String {
|
||||
val kind = ExplicitlyPolymorphic.serializer().descriptor.kind.toString()
|
||||
if (kind != "OPEN") return kind
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user