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

Mix scala 2 and 3 macros #395

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

gregghz
Copy link

@gregghz gregghz commented May 21, 2024

This follows the pattern shown here: https://docs.scala-lang.org/scala3/guides/migration/tutorial-macro-mixing.html#:~:text=Introduction,during%20the%20macro%20expansion%20phase

This would allow a mixed scala version project to depend on the scala 3 version of enumeratum and build correctly for both scala 2 modules and scala 3 modules. This is particularly helpful when building with bazel since you can't conditionally include a dependency based on the current scala version the same way you would in sbt.

This was brought up previously by @coreywoodfield here: #300 (comment) (and he is the author of this PR -- I just rebased the branch).

Scala 2 macros can be compiled in scala 3 only if they do not use
reification or quasiquotes
@lloydmeta
Copy link
Owner

Thanks for the PR but can you please add a description for this that explains why we want this?

@gregghz
Copy link
Author

gregghz commented May 21, 2024

@lloydmeta ah, thanks for taking a look. I've updated the description to clarify what's going on.

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.

3 participants