in anonymous class, static member class of enclosing class's parent not found
>Submitter-Id: net
>Originator: Andrew Pimlott
>Organization:
>Confidential: no
>Synopsis: in anonymous class, static member class of enclosing class's parent not found
>Severity: non-critical
>Priority: medium
>Category: java
>Class: rejects-legal
>Release: 3.0.4 (Debian testing/unstable)
>Environment:
System: Linux techloaner2 2.4.18-rc1techloaner2+ipsec #1 Sun Feb 17 12:37:21 EST 2002 i686 unknown
Architecture: i686
host: i386-pc-linux-gnu
build: i386-pc-linux-gnu
target: i386-pc-linux-gnu
configured with: ../src/configure -v --enable-languages=c,c++,java,f77,proto,objc --prefix=/usr --infodir=/share/info --mandir=/share/man --enable-shared --with-gnu-as --with-gnu-ld --with-system-zlib --enable-long-long --enable-nls --without-included-gettext --disable-checking --enable-threads=posix --enable-java-gc=boehm --with-cpp-install-dir=bin --enable-objc-gc i386-linux
>Description:
gcj fails to find a type that should (I think) be visible. javac and jikes
compile the code successfully. gcj compiles some variations of this code
correctly, so I'm not sure of the exact problem.
>How-To-Repeat:
Test case:
class Test extends Best {
{
new Object() {
public void foo() {
Rest r;
}
};
}
}
class Best {
protected static class Rest { }
}
Output:
Test.java:5: Type `Rest' not found in the declaration of the local variable `r'.
Rest r;
^
1 error
I could not find a simpler failure case. Rest can normally be accessed from
within Test, as expected. It seems to be only within a block in the
anonymous class that there is a problem. For example, a member variable in
the anonymous class of type Rest is ok.
>Fix:
--
To UNSUBSCRIBE, email to debian-gcc-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Reply to: