gcj/285: Overriding method in Interface confuses gcj
Bryce McKinlay
bryce@albatross.co.nz
Mon Jul 17 16:16:00 GMT 2000
The following reply was made to PR gcj/285; it has been noted by GNATS.
From: Bryce McKinlay <bryce@albatross.co.nz>
To: mark@klomp.org
Cc: java-gnats@sourceware.cygnus.com
Subject: Re: gcj/285: Overriding method in Interface confuses gcj
Date: Tue, 18 Jul 2000 11:01:57 +1200
This is a multi-part message in MIME format.
--------------26791560950A632C0C40BDF4
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
mark@klomp.org wrote:
> >Description:
> It is valid to override a method in a subinterface.
> (Although only really usefull for documentation purposes.)
> But gcj gets confused which method to call.
>
> This does actually occur when trying to compile AbstractSet
> from Classpath. (The workaround is to remove all methods
> from the Set interface since all those methods are already
> defined in Collection which is the super interface of Set.)
Thanks. This is actually a variant on PR234, which exposes a bug in the
fix for that PR. I've attached a patch below.
Possibly the test for "!max" should actually read "max", but that causes
the PR234 test to fail. Alex: why does the call to
valid_method_invocation_conversion_p from
find_most_specific_methods_list return false for the PR234 test case?
regards
[ bryce ]
--------------26791560950A632C0C40BDF4
Content-Type: text/plain; charset=us-ascii;
name="pr285.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="pr285.patch"
2000-07-18 Bryce McKinlay <bryce@albatross.co.nz>
* parse.y (find_most_specific_methods_list): Select the only
non-abstract method even if max has been set.
Index: parse.y
===================================================================
RCS file: /cvs/gcc/egcs/gcc/java/parse.y,v
retrieving revision 1.192
diff -u -r1.192 parse.y
--- parse.y 2000/07/13 19:27:49 1.192
+++ parse.y 2000/07/17 22:44:31
@@ -10325,7 +10325,7 @@
/* We have several, we couldn't find a most specific, all but one are
abstract, we pick the only non abstract one. */
- if (candidates > 0 && !max && (candidates == abstract+1))
+ if (candidates > 0 && (candidates == abstract+1))
{
for (current = new_list; current; current = TREE_CHAIN (current))
if (!METHOD_ABSTRACT (TREE_VALUE (current)))
--------------26791560950A632C0C40BDF4--
More information about the Java-prs
mailing list