I have my own map type: ```interface EnumMap<K ...
# serialization
I have my own map type:
Copy code
interface EnumMap<K : Enum<K>, out V> : Map<K, V> {
    override operator fun get(key: K): V

interface MutableEnumMap<K : Enum<K>, V> : EnumMap<K, V> {
    operator fun set(key: K, value: V)
and its corresponding implementation:
Copy code
class MutableEnumMapImpl<K : Enum<K>, V> : MutableEnumMap<K, V> {
    // ...
I also have a custom
for the base
type that basically mimics the built-in map serializer with some additional logic, but I can't figure out how to register it in my
so when it sees a
it serializes it using it
Copy code
class EnumMapSerializer<K : Enum<K>, V>(
    private val keySerializer: KSerializer<K>,
    private val valueSerializer: KSerializer<V>,
) : KSerializer<EnumMap<K, V>> {
    // ...
Any help would be greatly appreciated!
I have managed to do this by changing my interfaces to be abstract classes and setting
to the
abstract class, and it seems to work, but I would like to keep these as interfaces if possible.