Files
kotlin-fork/plugins/kotlin-serialization/kotlin-serialization-compiler/testData/diagnostics/SerializableIgnored.kt
T
Leonid Startsev de128a5406 kotlinx.serialization: Support @Serializable on sealed interfaces.
Interfaces (regular and sealed) are by default polymorphic. To benefit
from sealing (i.e. knowledge of all inheritors in compile-time), @Serializable
annotation may be added on sealed interface, generating the same serializer
that can be used for sealed classes.

Synthetic nested classes are not generated in DEFAULT_IMPLS mode because
it causes problems when adding a synthetic companion to an interface.

Fixes https://github.com/Kotlin/kotlinx.serialization/issues/1576
2021-12-01 14:14:47 +00:00

12 lines
244 B
Kotlin
Vendored

// !DIAGNOSTICS: -UNUSED_PARAMETER,-UNUSED_VARIABLE
// SKIP_TXT
// FILE: test.kt
import kotlinx.serialization.*
<!SERIALIZABLE_ANNOTATION_IGNORED!>@Serializable<!>
interface INonSerializable
@Serializable
sealed interface SealedSerializable