Comments (4)
Thank you for reporting!
This is a nice large test case for the deriveAll
macros.
I'll look into it and report back tomorrow.
from borer.
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?
from borer.
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!
from borer.
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!
from borer.
Related Issues (20)
- Warnings in generated codecs when `-Wnonunit-statement` option is used for Scala 2.13.x build
- Extra input fields cause error while decoding to empty case classes and case objects of an ADT HOT 5
- StackOverflowError when compiling with Scala 3 HOT 5
- When the encoded byte array exceeds 4m bytes, decode fails HOT 6
- Enable configuration of custom logic for transformation of map keys HOT 1
- Use Scala 3 syntax in documentation HOT 1
- Invalid codec derived - scala 3 - MatchError HOT 1
- Incorrect order of generated typeclasses for subnodes in `deriveAll`
- `deriveAll` should fail with compile-time error on bad ADTs
- An ode to borer, or: Please add support for scala-native HOT 13
- Add compat-pekko, as alternative to compat-akka HOT 3
- Possible issue with scala-3: dotty.tools.FatalError: cannot resolve reference HOT 1
- Issue with a Java-17 function calling Scala-3.3.0 version of "Codec#encoder()" HOT 2
- Scala.js – How to decode JS byte array types? HOT 12
- Add `borer-refined` module HOT 3
- Source maps should point to github HOT 10
- Key collision error in ADTs with type bounds HOT 12
- Issues with Scala 3 enums derived from a trait HOT 6
- `ByteStringArrayCodecs` not working on Scala 3 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from borer.