Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement auto derivation for scala 3 #68

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jchyb
Copy link

@jchyb jchyb commented Oct 29, 2024

Hello!
In this PR I reimplement the auto derivation features for scala 3 with full feature parity with the scala 2 counterpart. I reenable all of the tests for scala 3 as well, but still keep those in separate targets, as scala 3 requires explicit type annotations for implicits (if that is not a problem I can move those to the shared directory).

I tried to keep the reimplementation close to the shapeless counterpart, but instead I used:

  • mirrors, which are similar to the shapeless generic method, in that they give us information about the case classes, their label names and types
  • macros to reimplement the compile time information about the annotations and default values (we do cannot get those from mirrors, unfortunately)
  • occcasionally match types, mainly where the PolyN functions were used

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant