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 code structure builds correctly, but lacks ideal usage of generics.
classBase<T> {
constBase();
}
// Ideally, this would be `BaseConverter<T>` and `Base<T>`, but doing so breaks the buildclassBaseConverterextendsJsonConverter<Base, Json> {
constBaseConverter();
// Assume working implementations here :)@overrideJsontoJson(Base obj) =>throwUnimplementedError();
@overrideBasefromJson(Json json) =>throwUnimplementedError();
}
@Freezed(genericArgumentFactories:true)
classData<T> extendsBase<T> with_$Data<T> {
constData._();
// Ideally, this would be `@BaseConverter<T>()` and `Base<T>`, but doing so breaks the buildconstfactoryData(@BaseConverter() Base child) =_Data;
factoryData.fromJson(Json json, TFunction(Object?) fromJsonT) =>_$DataFromJson(json, fromJsonT);
}
The text was updated successfully, but these errors were encountered:
This is a json_serializable issue, not a Freezed one. Using a plain class leads to the same error. I'd suggest opening an issue on json_serializable and asking Kevin about it :)
The following code structure builds correctly, but lacks ideal usage of generics.
The text was updated successfully, but these errors were encountered: