84ad12be57
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
44 lines
1.3 KiB
Kotlin
Vendored
44 lines
1.3 KiB
Kotlin
Vendored
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
// FIR_IDENTICAL
|
|
// SKIP_TXT
|
|
// WITH_STDLIB
|
|
|
|
// FILE: test.kt
|
|
import kotlinx.serialization.*
|
|
|
|
|
|
interface InterfaceSerializer: KSerializer<WithInterfaceSerializer>
|
|
|
|
<!ABSTRACT_SERIALIZER_TYPE!>@Serializable(InterfaceSerializer::class)<!>
|
|
class WithInterfaceSerializer(val i: Int)
|
|
|
|
|
|
abstract class AbstractSerializer: KSerializer<WithAbstract>
|
|
|
|
<!ABSTRACT_SERIALIZER_TYPE!>@Serializable(AbstractSerializer::class)<!>
|
|
class WithAbstract(val i: Int)
|
|
|
|
|
|
sealed class SealedSerializer: KSerializer<WithSealed>
|
|
|
|
<!ABSTRACT_SERIALIZER_TYPE!>@Serializable(SealedSerializer::class)<!>
|
|
class WithSealed(val i: Int)
|
|
|
|
@Serializable
|
|
class Holder (
|
|
<!ABSTRACT_SERIALIZER_TYPE!>@Serializable(InterfaceSerializer::class)<!>
|
|
val withInterface: WithInterfaceSerializer,
|
|
|
|
<!ABSTRACT_SERIALIZER_TYPE!>@Serializable(AbstractSerializer::class)<!>
|
|
val withAbstract: WithAbstract,
|
|
|
|
<!ABSTRACT_SERIALIZER_TYPE!>@Serializable(SealedSerializer::class)<!>
|
|
val withSealed: WithSealed,
|
|
|
|
val ListWithInterface: List<<!ABSTRACT_SERIALIZER_TYPE!>@Serializable(InterfaceSerializer::class)<!> WithInterfaceSerializer>,
|
|
|
|
val ListWithAbstract: List<<!ABSTRACT_SERIALIZER_TYPE!>@Serializable(AbstractSerializer::class)<!> WithAbstract>,
|
|
|
|
val ListWithSealed: List<<!ABSTRACT_SERIALIZER_TYPE!>@Serializable(SealedSerializer::class)<!> WithSealed>
|
|
)
|