Open craiglabenz opened 2 months ago
I have same problem :c
class BaseConverter<T> extends JsonConverter<Base, Map<String, Object?>> {
What happens if you write Base<T>
there, instead of Base
?
Writing just Base
with no arguments is equivalent, IIUC, to writing Base<dynamic>
. Which doesn't seem like what you intend. And it makes sense that a converter that produces a Base<dynamic>
wouldn't be seen as a match when the field is supposed to hold more specifically a Base<T>
.
That said, I won't be surprised if that doesn't fix it. Here's a possibly related issue:
which suggests that the logic for applying a JsonConverter doesn't currently do everything one would hope it would when there are type parameters involved.
The following code builds, but see the comment for which critical information has to be removed for said build to succeed:
Changing
final Base data
tofinal Base<T> data
results in this error:This despite the fact that a
JsonConverter
is clearly being used.For posterity, I originally reported this at rrousselGit/freezed#1074, and was (correctly, it seems) directed here.