Anyone else seeing errors like this after upgradin...
# serialization
c
Anyone else seeing errors like this after upgrading to Kotlin 1.3.20? The class it’s trying to generate a serializer for has a custom serializer defined within it (code is at https://github.com/charleskorn/batect/blob/master/app/src/main/kotlin/batect/os/Command.kt)
s
You can workaround this for now by annotating
Iterable<String>
with
@ContextualSerialization
, but it's a bug – this check should not be emitted when class has a custom serializer.
c
OK, great to know it’s not just me 🙂
Is there a GitHub issue for this that I can track to know when it’s fixed?
s
ah, no, sorry: you haven't override
serialize
so plugin is right and some code is generated
c
Even if I add an implementation for
serialize
I get the same result
s
Ok, I'll create an issue
You can also workaround this by using
@Serializable(with=Command.Companion::class)
on a Command class itself
c
Thanks, that workaround works for the time being!
w
I tried such workaround, but then Kapt fails because it cannot find Companion
oops I just noticed the class was using
HashMap
as a type and not
Map
🤦‍♂️
some informative error would help