Files
kotlin-fork/plugins/kotlinx-serialization/testData/diagnostics/abstractCustomSerializer.kt
T
Sergey.Shanshin 2ae2f09fee [FIR] Fixed phase for FirCompanionGenerationProcessor to COMPANION_GENERATION
Phase COMPILER_REQUIRED_ANNOTATIONS causes errors in the kotlinx serialization tests:

org.jetbrains.kotlin.fir.symbols.FirLazyResolveContractViolationException: `lazyResolveToPhase(COMPILER_REQUIRED_ANNOTATIONS)` cannot be called from a transformer with a phase COMPILER_REQUIRED_ANNOTATIONS.
`lazyResolveToPhase` can be called only from a transformer with a phase which is strictly greater than a requested phase;
 i.e., `lazyResolveToPhase(A)` may be only called from a lazy transformer with a phase B, where A < B. This is a contract of lazy resolve
2024-02-12 15:54:11 +00:00

43 lines
1.3 KiB
Kotlin
Vendored

// 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>
)