4fa121071a
Properly set up dom-api-compat dependency for JS IR tests. Since this dependency is added automatically for every Kotlin/JS library, it should be present during tests just as stdlib. As a result, tests for serializable enums were changed since 1.6.0 runtime does not require enums to be explicitly serializable.
27 lines
908 B
Kotlin
Vendored
27 lines
908 B
Kotlin
Vendored
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
|
|
// FIR_IDENTICAL
|
|
// WITH_STDLIB
|
|
// FILE: test.kt
|
|
import kotlinx.serialization.*
|
|
import kotlinx.serialization.encoding.*
|
|
|
|
enum class SimpleEnum { A, B }
|
|
|
|
// Annotated enums do not require @Serializable if runtime has proper factory funciton (runtime ver. >= 1.5.0)
|
|
enum class MarkedNameEnum { @SerialName("a") A, B}
|
|
|
|
@Serializable
|
|
enum class ExplicitlyMarkedEnum { @SerialName("a") A, B}
|
|
|
|
@Serializable(EnumSerializer::class)
|
|
enum class ExplicitlyMarkedEnumCustom { @SerialName("a") A, B}
|
|
|
|
object EnumSerializer: KSerializer<ExplicitlyMarkedEnumCustom> {
|
|
override val descriptor = TODO()
|
|
override fun serialize(encoder: Encoder, value: ExplicitlyMarkedEnumCustom) = TODO()
|
|
override fun deserialize(decoder: Decoder): ExplicitlyMarkedEnumCustom = TODO()
|
|
}
|
|
|
|
@Serializable
|
|
data class EnumUsage(val s: SimpleEnum, val m: MarkedNameEnum, val e: ExplicitlyMarkedEnum)
|