de128a5406
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
12 lines
244 B
Kotlin
Vendored
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
|