This is the mail archive of the gcc-bugs@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/7299: Inner classes of parent not in namespace of child


>Number:         7299
>Category:       java
>Synopsis:       Inner classes of parent not in namespace of child
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Fri Jul 12 19:26:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Jesse Rosenstock
>Release:        3.2 20020710 (experimental)
>Organization:
>Environment:
System: Linux churchill 2.4.3-12 #1 Fri Jun 8 15:05:56 EDT 2001 i686 unknown
Architecture: i686

	
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ./configure --prefix=/home/user/jmr/app/gcc
>Description:
	If a class A defines an inner class AA, and B extends A, then
        references to B.AA fail.
>How-To-Repeat:
	A.java:

        public class A {
            public static class AA { }
        }

        B.java:

        public class B extends A {
        }

        C.java:

        public class C {
            B.AA f() {
                return null;
            }
        }

        gcj -v C.java:

        Reading specs from /home/user/jmr/app/gcc/lib/gcc-lib/i686-pc-linux-gnu/3.2/specs
        Reading specs from /home/user/jmr/app/gcc/lib/gcc-lib/i686-pc-linux-gnu/3.2/../../../libgcj.spec
        rename spec lib to liborig
        Configured with: ./configure --prefix=/home/user/jmr/app/gcc
        Thread model: single
        gcc version 3.2 20020710 (experimental)
         /home/user/jmr/app/gcc/lib/gcc-lib/i686-pc-linux-gnu/3.2/jc1 C.java -fno-use-divide-subroutine -fuse-boehm-gc -fnon-call-exceptions -fkeep-inline-functions -quiet -dumpbase C.java -g1 -version -o /tmp/ccE77Fbe.s
        GNU Java version 3.2 20020710 (experimental) (i686-pc-linux-gnu)
                compiled by GNU C version 2.96 20000731 (Red Hat Linux 7.1 2.96-85).
        Class path starts here:
            /home/user/jmr/gcj_test/inner3/
            /home/user/jmr/app/gcc/share/java/libgcj-3.2.jar/ (system) (zip)
        C.java:2: error: Type `B.AA' not found in the declaration of the return type of method `f'.
               B.AA f() {
               ^
        1 error

        This works with javac.
>Fix:
	A workaround is to mark C.f as returning A.AA instead of B.AA.
>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]