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
Both circe and pureconfig are based on shapeless, so right now we can't write this and have to workaround by using Cached[Lazy[_]]. Non-shapeless based derivations work as expected however.
The text was updated successfully, but these errors were encountered:
The trouble is the materialized Generic[T], where T is instantiated at a case class, will embed a reference to the case class companion. Hence your construct object Abc extends WithGeneric[Abc] is self-referential in a way that's not easily fixed.
It's just conceivable that byname implicits in 2.13.x will make it possible to make some progress, but for now I don't think there's a lot that can be done.
It's just conceivable that byname implicits in 2.13.x will make it possible to make some progress, but for now I don't think there's a lot that can be done.
This could be mitigated if case classes use constructors and field access instead of the companion's apply / unapply but it's tricky to do. I remember attempting that at some point and it didn't work.
As an example, the following code breaks:
with error:
Note that changing the name of the object makes it work:
Our use case for this is that we want to be able to define helper traits that provide
circe
&pureconfig
codec instances for case classes:Both
circe
andpureconfig
are based on shapeless, so right now we can't write this and have to workaround by usingCached[Lazy[_]]
. Non-shapeless based derivations work as expected however.The text was updated successfully, but these errors were encountered: