Skip to content

ecj ignores error "cannot select a static class from a parameterized type" #4702

@nbauma109

Description

@nbauma109

Here's a minimal demo:

public class OuterStaticNestedDemo<E> {
    class Outer {
        static class StaticNested {}
    }

    void qualifiedNew(Outer outer) {
        new Outer.StaticNested();
    }
}

When I compile with javac, it raises an error (using version 25 here, but it's the same for versions 11, 17 and 21) :

javac -g -source 25 -target 25 OuterStaticNestedDemo.java
OuterStaticNestedDemo.java:8: error: cannot select a static class from a parameterized type
        new Outer.StaticNested();
                 ^
1 error

When I compile with ecj, it compiles :

java -jar ecj-3.44.0.jar -g -source 25 -target 25 OuterStaticNestedDemo.java

Could you please fix to raise the same error as javac ?

Metadata

Metadata

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions