[lworld] RFR: 8341182: [lworld] test CantAnnotateScoping.java fails after merge, due to experimental code for anonymous value classes

Vicente Romero vromero at openjdk.org
Fri Oct 4 01:59:31 UTC 2024


On Fri, 4 Oct 2024 01:52:23 GMT, Vicente Romero <vromero at openjdk.org> wrote:

> there was experimental code in lworld to allow anonymous value classes, after removing this code the test passed again

src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java line 2567:

> 2565:      */
> 2566:     JCExpression creator(int newpos, List<JCExpression> typeArgs) {
> 2567:         final JCModifiers mods = modifiersOpt();

this code was here to allow programs like:


Object o = new value Comparable<>() {
    @Override
    public int compareTo(Object o) {
        return 0;
    }
};


modifiersOpt() interprets all annotations as declaration annotations, even type annotations, this produced a different golden file for the test

-------------

PR Review Comment: https://git.openjdk.org/valhalla/pull/1264#discussion_r1787018616


More information about the valhalla-dev mailing list