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

Added Scala 3 derived support #157

Merged
merged 3 commits into from
Jul 2, 2023
Merged

Added Scala 3 derived support #157

merged 3 commits into from
Jul 2, 2023

Conversation

TonioGela
Copy link
Member

I'm not 100% sure that this may be enough to add Scala 3 derivation support, as idk what will happen to non-product types, but "works on my machine™" on case classes.

Also, I saw that the tests are not split by version, so I'll wait for your instructions about how to test it.

Thanks :D

@TonioGela TonioGela changed the title Added Scala 3 derives support Added Scala 3 derived support May 30, 2023
@darkfrog26
Copy link
Contributor

@TonioGela thanks for this! We don't currently have separate tests, but if you feel up to adding a Scala 3 specific unit test that would be great.

@TonioGela
Copy link
Member Author

@TonioGela thanks for this! We don't currently have separate tests, but if you feel up to adding a Scala 3 specific unit test that would be great.

Okay, I'll try to come up with some scala 3 specific tests, maybe asking for some help.

Also, can I ask you a question? Is it me or I can't see a generic auto derivator that uses a generic Mirror.Of[T] instead of Mirror.ProductOf[T]? Is it possible for the moment to only auto derivate product types?

@darkfrog26
Copy link
Contributor

I'm not sure I understand your question. To be honest, my Scala 3 knowledge is still a bit hacky, so it's possible I'm doing some less-than-ideal things in my code. I'd welcome any insights and suggestions to improve the code.

@TonioGela
Copy link
Member Author

To be honest, my Scala 3 knowledge is still a bit hacky.

If we speak about macro, we're in two 😄
My question was related to the library capabilities, I was wondering if it is possible to autogenerate automatically, using RW.gen, a codec for every type hierarchy, both product and sum types. I'll try to study the lib a bit more in this sense and add some eventual tests 😇

@darkfrog26
Copy link
Contributor

Oh, you mean like how Circe has the capability to auto-derive without needing the implicit val rw: RW[?] = RW.gen for each type? I used to use that with Circe and found the compile-time costs were insane as complexity grew, so I intentionally left that out.

@darkfrog26
Copy link
Contributor

@TonioGela any updates on this? I'd love to merge it.

@TonioGela
Copy link
Member Author

TonioGela commented Jun 27, 2023

Sorry, last weeks have been really busy. I'll write some tests before the week ends and I'll add them to the PR so we can merge it, promess!

@TonioGela
Copy link
Member Author

@darkfrog26 I added some trivial tests with Scala3 that at least can test the derivation syntax. In another PR, I might help you add some property-based tests to the whole project.

@darkfrog26
Copy link
Contributor

Great work! Thanks!

@darkfrog26 darkfrog26 merged commit 350169e into typelevel:master Jul 2, 2023
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.

2 participants