This is the mail archive of the
java-prs@sources.redhat.com
mailing list for the Java project.
Re: gcj/283: GCJ fails to compile inner classes which extend another inner class
- To: apbianco at cygnus dot com
- Subject: Re: gcj/283: GCJ fails to compile inner classes which extend another inner class
- From: Bryce McKinlay <bryce at albatross dot co dot nz>
- Date: 15 Jul 2000 06:30:00 -0000
- Cc: java-prs at sourceware dot cygnus dot com,
- Reply-To: Bryce McKinlay <bryce at albatross dot co dot nz>
The following reply was made to PR gcj/283; it has been noted by GNATS.
From: Bryce McKinlay <bryce@albatross.co.nz>
To: java-gnats@sourceware.cygnus.com
Cc:
Subject: Re: gcj/283: GCJ fails to compile inner classes which extend another
inner class
Date: Sat, 15 Jul 2000 18:22:39 +1200
Mark Wielaard wrote:
> You might want to try the patch attached to gcj/256
> <http://sources.redhat.com/cgi-bin/gnatsweb.pl?cmd=view&pr=256&database=java>
> That solves the problem for me.
>
> Note that in your example you try to extend InnerB from a non static
> innerclass InnerA which is not legal. Making InnerA a public static class
> would be a valid example.
I agree. With the PR256 patch applied, I get the correct error trying to
compile this test:
$ gcj -c *.java
OuterB.java: In class `OuterB$InnerB':
OuterB.java: In method `<init>(OuterB)':
OuterB.java:4: No enclosing instance for inner class `OuterA$InnerA' is
in scope; an
explicit one must be provided when creating this inner class.
}
^
1 error
However, throw some .class files into the mix and it all goes wrong:
$ javac OuterA.java
$ ls -l *.class
-rw-rw-r-- 1 bryce bryce 320 Jul 15 18:14
OuterA$InnerA.class
-rw-rw-r-- 1 bryce bryce 245 Jul 15 18:14 OuterA.class
$ gcj -c *.java
OuterB.java:2: Superclass `OuterA.InnerA' of class `OuterB$InnerB' not
found.
public class InnerB extends OuterA.InnerA {
^
gcj: Internal error: Segmentation fault (program jc1)
Please submit a full bug report.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
regards
[ bryce ]