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

[Scala 3] Macro.anns throws IllegalAccessError when used on parameters with Java types on JDK17+ #493

Closed
kyri-petrou opened this issue Oct 21, 2023 · 1 comment · Fixed by #495

Comments

@kyri-petrou
Copy link
Contributor

Hi there 👋

There seems to be an issue when using Macro.anns on case class parameters that are Java types on JDK17+ (works fine on JDK11). I created a small reproduction via scatsie here.

The fix to the issue is quite straightforward, and it's to add the following condition to the filterAnnotation method: a.tpe.typeSymbol.owner.fullName != "jdk.internal". Please let me know if you'd like me to create a PR for it and I'll do so

Please note that AFAICT, Macro.paramAnns works as intended, although I thought to let you know since the fix is relatively simple and there might be edge cases where a user will want to extract the param annotations manually as in the repro above

@kyri-petrou kyri-petrou changed the title [Scala 3] Macro.anns throws when used on parameters with Java types on JDK17+ [Scala 3] Macro.anns throws IllegalAccessError when used on parameters with Java types on JDK17+ Oct 21, 2023
@adamw
Copy link
Member

adamw commented Oct 21, 2023

Yes, please do create a PR :)

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 a pull request may close this issue.

2 participants