This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: java/4568: importing static inner classes fails
- From: Mike Salisbury <salisbur at yahoo-inc dot com>
- To: gcc-gnats at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, gcc-bugs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, s dot nicolas at videotron dot ca, java-prs at gcc dot gnu dot org
- Date: Wed, 29 May 2002 12:35:46 -0700
- Subject: Re: java/4568: importing static inner classes fails
- Organization: Yahoo! Inc.
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