java/4568: importing static inner classes fails
Mike Salisbury
salisbur@yahoo-inc.com
Wed May 29 12:36:00 GMT 2002
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=4568
this also seems to be a problem when importing the outerclass and
then trying to refer to the innerclass without fully qualifying it:
---------------------
Foo.java:
package pkg;
public class Foo {
public static class Inner {
public void test() {
System.out.println("footest");
}
}
}
--------------------
Bar.java:
package pkg;
import pkg.Foo;
public class Bar extends Foo.Inner {
public void test() {
System.out.println("bartest");
}
}
--------------------
$ gcj -c pkg/*
pkg/Bar.java:5: Superclass `Foo.Inner' of class `pkg.Bar' not found.
public class Bar extends Foo.Inner {
^
adding the package name to the extends clause (pkg.Foo.Inner)
fixes things. javac has no problem with this. note that this
works fine if Foo is not in a package and is therefore already
fully qualified.
-MikeSalisbury
More information about the Gcc-bugs
mailing list