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

Fix #1352 using magnolia macros #1952

Merged
merged 3 commits into from
Oct 22, 2023
Merged

Fix #1352 using magnolia macros #1952

merged 3 commits into from
Oct 22, 2023

Conversation

kyri-petrou
Copy link
Collaborator

The main issue seems to be when using Macro.anns to inspect the annotations of parameters for Product types within the recurse method. After taking a closer look at the code, it seems that we are unnecessarily double-extracting the parameter annotations for Product due to reusing the same recurse method for both Sum and Product types.

With this PR, we use different recurse methods for Product and Sum types. This solves this issue since the parameter annotations are now extracted via Macro.paramAnns which works fine on JDK17+. To demonstrate, I added 2 unit tests for it and added test workflows for JDK17 for Scala 3 (also for Scala 2.13 for completeness).

While the underlying issue with Magnolia still exists (see here), I think we should still do the separation as now macros that are specific to product/sum types are only executed when needed, which results in reduced compilation time + codegen size

@kyri-petrou kyri-petrou merged commit 74a8a88 into series/2.x Oct 22, 2023
@kyri-petrou kyri-petrou deleted the fix-magnolia-jdk17 branch October 22, 2023 11:16
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