This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: java/4568: static inner classes fails
- From: Bryce McKinlay <bryce at waitaki dot otago dot ac dot nz>
- 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
- Date: Fri, 08 Feb 2002 13:02:50 +1300
- Subject: Re: java/4568: static inner classes fails
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=4568
Nic Ferrier sent this test case.
file a.java:
public class A
{
public static X createSomething ()
{
return new X();
}
public class X
{
public void someMethod ()
{
return;
}
}
}
file b.java:
import A.X;
public class B
{
public void someThing ()
{
X var = A.createSomething();
var.someMethod();
}
}
But trying to compile this with GCJ produces the following error:
./../paperclips/source/gnu/paperclips/WebApp.java:173:
Type `X' not found in the declaration of the local variable `var'.
X var = (X) A.createSomething();
This does compile with javac.
If GCJ does this it won't be able to compile javamail which also uses
import references to inner classes.