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
import shapeless.LabelledGeneric
implicit def genericObjectEncoder[A, H <: HList]( // <--- this is where I think <: HList should be removed
implicit
generic: LabelledGeneric.Aux[A, H],
hEncoder: Lazy[JsonObjectEncoder[H]]
): JsonEncoder[A] =
createObjectEncoder { value =>
hEncoder.value.encode(generic.to(value))
}
has the type constraint H <: HList which I think is too constrained. This works fine for the product IceCream example but in the coproduct Shape example, Scala can't find an implicit encoder since Coproduct is not an HList.
Please let me know if this is a problem or if there is a better way to do this. I just removed <: HList from my code on the H parameter and then everything worked as described.
If this is an issue I can fix it and file a pull request as well just let me know.
Thanks.
The text was updated successfully, but these errors were encountered:
The function
has the type constraint H <: HList which I think is too constrained. This works fine for the product IceCream example but in the coproduct Shape example, Scala can't find an implicit encoder since Coproduct is not an HList.
Please let me know if this is a problem or if there is a better way to do this. I just removed <: HList from my code on the H parameter and then everything worked as described.
If this is an issue I can fix it and file a pull request as well just let me know.
Thanks.
The text was updated successfully, but these errors were encountered: