-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix emission of annotations #1763
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
Looks like this unmasked an issue with the inline body annotations, investigating... |
Backend-wise LGTM |
`isRuntimeVisible` and `retentionPolicyOf` had two different ways to get the retention policy of an annotation and they were both wrong. Fix retentionPolicyOf` and use it in `isRuntimeVisible`
Previously we replaced them by ConcreteAnnotation so they became regular annotations and could be emitted in some cases. They need to keep being BodyAnnotation.
9b52ca5
to
3d0accd
Compare
This still isn't enough to fix #1741, turns out sbt uses the incremental compilation analysis to know which methods have special annotations and need to be run with a test interface, but I never implemented support for annotations in incremental compilation: https://github.com/lampepfl/dotty/blob/b9350f40990ce07ba7614a0448a98abd7075abe8/compiler/src/dotty/tools/dotc/sbt/ExtractAPI.scala#L501, so I know what I need to do next! |
5979c20
to
2dc65a9
Compare
Alright, #1741 is fixed by the latest commit, and I added a test to test that the tests are testing something :) |
This is necessary for correct incremental recompilation but is also used by sbt to find tests to run (for junit they should be annotated @org.junit.Test). I added an sbt scripted test to verify that JUnit now works, to run it: $ sbt > scripted discovery/test-discovery
2dc65a9
to
9411539
Compare
Well done @smarter 👍 ! |
Ping @DarkDimius , would you mind review the remaining commits? |
LGTM |
Review by @DarkDimius