Closed guntiso closed 1 year ago
Thank you for reporting!
This is a nice large test case for the deriveAll
macros.
I'll look into it and report back tomorrow.
Your example is excellent, since it contains a lot of important example cases for how complicated the dependencies between the sub nodes of an ADT can be.
Based on this example I was able to significantly improve the logic which drives the deriveAll
macros.
Would it be ok if I included a stripped down version of your ADT in the tests for borer?
I.e. would you be ok with donating your ADT to the project as a test example?
I've significantly improved the deriveAll
logic, which should now be able to properly detect and automatically resolve all cycling dependencies within a complex ADT such as yours.
The ADT in your example can now receive its Codec
with a simple:
given Codec[Exp] = {
import MapBasedCodecs._
given Codec[ExprType] = deriveCodec
given Codec[TableColDef] = deriveCodec
deriveAllCodecs[Exp]
}
Note that ExprType
and TableColDef
still need their own line because they aren't part of the ADT.
I've included your ADT as a test case, because it demonstrates a lot of previously untested phenomena, such as dependencies and recursion into abstract sub types. Please let me know if you would like me to take it out again, maybe due to some IP-related issue!
Thanks again for reporting!
Would it be ok if I included a stripped down version of your ADT in the tests for borer? I.e. would you be ok with donating your ADT to the project as a test example?
Ok. Thanks for the fix!
Does not compile because
Could not find implicit Encoder[CompilerAst.SQLDefBase]
etc etc. ButSQLDefBase
isExp
.