-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Add synthetic constructors only to Java annotations #10016
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
Conversation
Is there some kind of 2.12 alternative for this |
I did take a look earlier and wanted to 😃 on "go nuts". The unfortunate build error dissuaded me from looking further. I almost commented, "Just when you think it's an easy backport..." |
I'm required to do further penance because I broke the community build. Is this considered a desirable backport because people on 2.12 are likely to be using Or was it hoped to be fruit of a low-hanging variety. Like strawberries. IIRC retronym did work on both branches: it's genuine retronym, not a knock-off. I saw the NPE in test but hadn't looked yet. |
I use it on 2.12. I don't know about other people. |
Lukas's javaVersion was an easier backport so I did that first, at your urging. POC
|
The zinc NPE is an interaction with Lukas's sbt/zinc@c25d956 where the common elements is lazy completion of annotation info, but I don't understand the cogs yet. That is really the point of the whole misadventure. |
@Jasper-M the window for 2.12.16 is closing soon |
I can explain the NPE, a bunch of things playing together here... // current 2.13 version
(sflags & (INTERFACE|JAVA_ANNOTATION)) == (INTERFACE|JAVA_ANNOTATION) Note that we're using
which is due to this (really nice) cleanup: 7c9e3724ee#diff-b47f6177947626919b42f078a149a0e822e464c4a96b39c2dfbaef1f2e43ea34 So backporting the 2.13 version to 2.12 meant that no more artificial constructors were added to Java annotations at all (
scala/src/compiler/scala/tools/nsc/typechecker/Typers.scala Lines 5048 to 5051 in 29e696f
The I'm all for the nutty version, also for forward-porting it to 2.13. |
Thanks @lrytz and @som-snytt. I'm on holiday so I had more or less resigned to missing 2.12.16. |
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.
It's no coincidence that the dashboard icon on my car for "lane keep assistance", that keeps you from driving off a cliff, is LKAS
.
I'll offer the forward port.
src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
Outdated
Show resolved
Hide resolved
5f67938
to
63b21b2
Compare
63b21b2
to
1a33a74
Compare
The diff is an ideal |
@lrytz you already approved the forward-port; did you mean to approve this one as well? |
Hard to say who should approve it :-) LGTsom & LGTM, so 🚀 |
Backport of #9981, but with improvements to be forward-ported.