java/7290: Inherited method not found when extending abstract class
Fri Jul 12 13:06:00 GMT 2002

>Number:         7290
>Category:       java
>Synopsis:       Inherited method not found when extending abstract class
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Fri Jul 12 13:06:01 PDT 2002
>Originator:     Jesse Rosenstock
>Release:        3.2 20020710 (experimental)
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
	If there is an interface I with one method f(), and AX is an
        abstract class implementing I, and AY is marked as extending AX
        (but not marked as implementing I), and AY contains a method
        g() that calls f(), the will not compile.
	Create the files:

        public interface I {
            void f();

        abstract class AX implements I { }

        abstract class AY extends AX /*implements I*/ {
            void g() {

        Then gcj -v fails as follows:

        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 -fno-use-divide-subroutine -fuse-boehm-gc -fnon-call-exceptions -fkeep-inline-functions -quiet -dumpbase -g1 -version -o /tmp/ccUMp3aH.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/app/gcc/share/java/libgcj-3.2.jar/ (system) (zip) In class `AY': In method `AY.g()': error: No method named `f' in scope.
        1 error

        It works if AY is also marked as implementing I, so this is a

        This code compiles with javac.

More information about the Gcc-bugs mailing list