gcj/373: interface inner classes are implicitly static

osk@hem.passagen.se osk@hem.passagen.se
Thu Nov 23 12:40:00 GMT 2000

>Number:         373
>Category:       gcj
>Synopsis:       interface inner classes are implicitly static
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    apbianco
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Nov 23 12:40:00 PST 2000
>Originator:     Oskar Liljeblad
>Release:        unknown-1.0
gcj 2.97 20001106
I think gcj should not require the static keyword for
inner classes in interfaces.

$ cat demo.java 
interface Interface {
    public class Inner {}
class Main {
    public static void main(String[] args) {
        new Interface.Inner();
$ gcj -C demo.java
demo.java: In class `Main':
demo.java: In method `main(java.lang.String[])':
demo.java:7: No enclosing instance for inner class `Interface$Inner' is in scope.
                new Interface.Inner();
1 error

Oskar Liljeblad (osk@hem.passagen.se)

Should be simple (but I haven't studied compiler technologies

More information about the Java-prs mailing list