You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following file throws in the generator (probably because it tries to compare the type Child<T> with ChildMixin<T>).
I also reported this at rrousselGit/freezed#766 but perhaps it's something that can be fixed in json_serializable.
If I move the toJson method to the Child class, it works fine.
I dug in longer than I should have. We have to map generic types across to the mixin, which is CRAZY complex. There isn't a clean, clear way to resolve this, sadly. 🤷
I dug in longer than I should have. We have to map generic types across to the mixin, which is CRAZY complex. There isn't a clean, clear way to resolve this, sadly. 🤷
Thanks for looking into this! Yeah, I tried to understand it too, but I'm pretty new to Dart :)
For now it works to @override the toJson method in the Child class, because mixin is a form of inheritance. I guess it's something that needs to be documented in freezed.
The following file throws in the generator (probably because it tries to compare the type
Child<T>
withChildMixin<T>
).I also reported this at rrousselGit/freezed#766 but perhaps it's something that can be fixed in json_serializable.
If I move the
toJson
method to the Child class, it works fine.build_runner build -v
pubspec.yaml
bug.dart
The text was updated successfully, but these errors were encountered: