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]

[Bug java/13638] New: Method scope error with multiple inheritance of interfaces/abstract classes.


This source file:
-- Test.java
interface A { void inheritedAbstractMethod(); }
interface B extends A {}
abstract class C implements B {}
abstract class D extends C {
  void problemMethod() {
    inheritedAbstractMethod(); // Should be in scope, but gcj doesn't find it.
  }
}
--

generates this compilation error:
--
> gcj -v -save-temps Test.java
Reading specs from /usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.3.2/specs
Reading specs from /usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.3.2/libgcj.spec
rename spec lib to liborig
Configured with: ../configure --prefix=/usr --libdir=/usr/lib
--with-slibdir=/lib --mandir=/usr/share/man --infodir=/usr/share/info
--enable-shared --enable-threads=posix --disable-checking --enable-long-long
--enable-__cxa_atexit --enable-languages=c,c++,ada,f77,objc,java,pascal
--host=i586-mandrake-linux-gnu --with-system-zlib
Thread model: posix
gcc version 3.3.2 (Mandrake Linux 10.0 3.3.2-4mdk)
 /usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.3.2/jc1 Test.java
-fhash-synchronization -fno-use-divide-subroutine -fuse-boehm-gc
-fnon-call-exceptions -fkeep-inline-functions -quiet -dumpbase Test.java
-auxbase Test -g1 -version -o Test.s
GNU Java version 3.3.2 (Mandrake Linux 10.0 3.3.2-4mdk) (i586-mandrake-linux-gnu)
        compiled by GNU C version 3.3.2 (Mandrake Linux 10.0 3.3.2-4mdk).
GGC heuristics: --param ggc-min-expand=46 --param ggc-min-heapsize=30899
Class path starts here:
    ./
    /usr/share/java/libgcj-3.3.2.jar/ (system) (zip)
Test.java: In class `D':
Test.java: In method `D.problemMethod()':
Test.java:6: error: No method named `inheritedAbstractMethod' in scope.
     inheritedAbstractMethod(); // Should be in scope, but gcj doesn't find it.
     ^
1 error
--

with this temporary file:

--
> cat Test.s
        .file   "Test.java"
        .file 1 "Test.java"
        .section        .debug_abbrev,"",@progbits
.Ldebug_abbrev0:
        .section        .debug_info,"",@progbits
.Ldebug_info0:
        .section        .debug_line,"",@progbits
.Ldebug_line0:
        .text
.Ltext0:
.Letext0:
        .section        .debug_abbrev
        .byte   0x0
        .section        .note.GNU-stack,"",@progbits
        .ident  "GCC: (GNU) 3.3.2 (Mandrake Linux 10.0 3.3.2-4mdk)"
--

The same source file compiles under javac and jikes.

-- 
           Summary: Method scope error with multiple inheritance of
                    interfaces/abstract classes.
           Product: gcc
           Version: 3.3.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: java
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pablo at freality dot com
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13638


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