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 #19369 - duplicate macro execution in unapply methods #19381

Closed
wants to merge 1 commit into from

Conversation

jchyb
Copy link
Contributor

@jchyb jchyb commented Jan 5, 2024

It looks like the macro really was called twice - first an unapply application is typed in typedUnapply (and thus the transparent inline macro expansion is run), and then a custom method inlinedUnapply is run (which inlines the unapply and also also wraps the unapply with a anon class). I've disabled inlining for the first call, so now only the second should be run.

I've had some trouble preparing the tests, as it is impossible in our test suite to inspect stdout in a clean way and warnings/report would only be reported once. I remembered, however, that this issue caused me another problem when inspecting trees of splice owner and macro expansion would get triggered recursively, which is also fixed by this, as the first, now disabled call, was run in a bit of a non-standard context. Hopefully this test is enough.

Fixes #19369

@jchyb jchyb closed this Jan 5, 2024
@jchyb
Copy link
Contributor Author

jchyb commented Jan 5, 2024

Just noticed the same fix was already submitted (with a better test), so closing

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.

transparent inline unapply method macros are executed twice
1 participant