-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix #9463: create varargs forwarder symbols in transform instead of transformDefDef #9474
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 #9463: create varargs forwarder symbols in transform instead of transformDefDef #9474
Conversation
Better than a crash :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this is missing a pos test with the code from #9463 ?
Also move some disabled tests to run tests, and rename vararg-extend-java to varargs-extend-java
Oopsie 👀 Here are the tests. |
I don't understand why |
Hmm, not sure what's going on. One thing I see is that |
🤔 Hmmm |
61c6903
to
6470833
Compare
It works! 🎉 |
@@ -62,9 +62,9 @@ class ElimRepeated extends MiniPhase with InfoTransformer { thisPhase => | |||
super.transform(ref) match | |||
case ref1: SymDenotation if ref1.is(Method) => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Originally the ref1 ne ref
was here which I think is equivalent to what the code is doing now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not quite, because now transformVarArgs
is called for all methods. If I move ref1 ne ref
back to the case
guard, some situations are not covered and e.g. tests/neg/varargs-annot
fails.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't new to this PR, but I've noticed something weird with this phase: it extends InfoTransformer
, which are supposed to only change the info of denotation and leave everything else alone, but in this phase we actually override transform
to do more stuff on top of that, so it's a bit misleading. I think it'd be good to rewrite as a regular DenotTransformer
, especially now that transform
has gotten more complicated.
65a9ff5
to
61f860a
Compare
This allows the forwarder symbols to be visible during separate compilation.
See smarter's comment in #9463.