> Class `ArrayList` is not registered for polym...
# serialization
m
Class
ArrayList
is not registered for polymorphic serialization in the scope of
Any
. Mark the base class as
sealed
or register the serializer explicitly.
Class
SingletonList
is not registered for polymorphic serialization in the scope of
Any
. Mark the base class as
sealed
or register the serializer explicitly.
Do I really have to do this dance for every possible implementation of
Collection
? 😮 Also, how do I register subclasses of
Collection
? There’s no
Collection.serializer()
or
ArrayList.serializer()
I could use for polymorphism 🤔
j
You don't register for subtypes. You delegate to
List.serializer()
by calling
toList()
on the
Collection
value first (in a serializer for
Collection
)
m
The list is boxed generically multiple times, e.g.
Foo<Bar<*>>
where
*
has no upper bound and may be a
Collection<Something>
. It looks like I cannot solve that with a polymorphic serializer 😕
Even if I can pass the serializer for
<T>
I’d still have to provide an own
Collection
serializer and cannot rely on
serializer<T>()
? ugh 😕