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

Parse annotation in jointly compiled Java source files and honour @Deprecated #8781

Merged
merged 2 commits into from May 8, 2020

Commits on Apr 24, 2020

  1. Implement annotation parsing in JavaParsers.

    This causes the java parser to get somewhat more complex, but
    allows for macros and compiler plugins to correctly inspect
    java-defined classes for annotations.
    
    Moved a few utility methods into {Parsers,Scanners}Common as well,
    so I can reuse them in the java ones.
    
    This involves a change to the t4788 tests, as SAnnotation now
    correctly has RetentionPolicy.SOURCE, and is therefore ignored
    by the check in BCodeHelpers#BCAnnotGen.shouldEmitAnnotation;
    also, ASM Textifier emits an // invisible marker now that
    CAnnotation has RetentionPolicy.CLASS. I'm not sure what the
    chances that anyone is relying upon this behavior are, but
    since it does the Right Thing for separate compilation runs,
    they probably should not be too disappointed.
    
    The new tests are run-tests not just pos-tests at the suggestion
    of retronym, to ensure that everything works the same at runtime
    as it does at compile time. As a matter of fact, it doesn't: the
    compile-time universe maintains ordering of annotation values in
    the tree, while the runtime universe uses java reflection to get
    at the values and therefore cannot know of their order. The test
    contains one exception for that.
    
    Review by densh, retronym
    
    Fixes scala/bug#8928
    
    Co-authored-by: Jason Zaugg <jzaugg@gmail.com>
    Co-authored-by: Dale Wijnand <dale.wijnand@gmail.com>
    3 people committed Apr 24, 2020
    Configuration menu
    Copy the full SHA
    c2db27f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3c89087 View commit details
    Browse the repository at this point in the history