-
Notifications
You must be signed in to change notification settings - Fork 121
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
Overcompilation for dependencies of classes using (not defining) macros #1333
Comments
Thanks for the bug report!
My understanding might be incorrect, but I think As for over compilation issue, addressing this will require some sophisticated analysis like com-lihaoyi/mill#2417. Despite |
Indeed.
The change in my PR was intended to fix any changes in the macro implementation, where here the change is in the macro (I'm not even sure what we call it) definition site, or rather in the same class as the macro def. So perhaps we have the toggles to distinguish that, but I'm not certain. |
Is there a different utility for getting all classes compiled in the compiler run?
When I was first minimizing this issue, I was thinking that this change implied that any use of macros to derive typeclasses (eg. for serialization) would be impacted, but I think I was wrong. This is how I now understand the new functionality: Given:
If I change anything in
Am I understanding correctly? Thanks! |
Maybe
I think your understanding is correct. For As for By the way, is it common in practice to have |
Took a while, but finally got around to pulling all of our uses of the As such I would argue that this is working as intended, but I do suspect that a lot of users of macros will be bitten by the same issue so maybe the fix is some way to document the best practices here. We basically took any classes that had
You're required by Scalac to have the macro implementation ( In any case, I think it's fine to close this issue, but will defer to the maintainers. Many thanks for your explanations! |
Correction, apparently this is not the case. I thought it was for the entirety of the ~10 years I've been writing Scala lol. It seems that calls of |
steps
Apply the following patch to the zinc git repository:
Then run the test:
problem
The test will fail with:
The expected value of just
B
being recompiled is the ideal result with no overcompilation.expectation
If you run this test on
v1.9.6
orv1.10.0-M1
, it passes. It fails onv1.10.0-M2
and head ofdevelop
.notes
I bisected this down to @dwijnand's PR #1282. More specifically, commit c7bcc06.
What is a little bit weird, is if you run this test on that commit, you get that
B
,C
, andD
are all recompiled which is what I would call the "overcompilation" result--it's at least correct. Starting with commit 55fa091, it started giving the current result,D
, which I think is wrong--obviouslyB
needs to be recompiled since it changed.The text was updated successfully, but these errors were encountered: