kotools / types

Explicit types for Kotlin Multiplatform.
https://types.kotools.org
MIT License
89 stars 5 forks source link

✨ New `ZeroAsIntSerializer` type #695

Open LVMVRQUXL opened 1 month ago

LVMVRQUXL commented 1 month ago

πŸ“ Description

Similarly to #690, in the types-kotlinx-serialization subproject, we want to introduce the ZeroAsIntSerializer experimental type for serializing the Zero type as Int.

class ZeroAsIntSerializer : KSerializer<Zero> {
    override val descriptor: SerializerDescriptor

    override fun equals(other: Any?): Boolean
    override fun hashCode(): Int
    override fun serialize(encoder: Encoder, value: Zero)
    override fun deserialize(decoder: Decoder): Zero
    override fun toString(): String
}

This serializer should be available for all Kotlin platforms.

βœ… Checklist