This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

java/6464: in anonymous class, static member class of enclosing class's parent not found



>Number:         6464
>Category:       java
>Synopsis:       in anonymous class, static member class of enclosing class's parent not found
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Thu Apr 25 17:46:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Andrew Pimlott
>Release:        3.0.4 (Debian testing/unstable)
>Organization:
>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:
	
>Release-Note:
>Audit-Trail:
>Unformatted:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]