User account creation filtered due to spam.

Bug 12741 - Error when package-private method matches superclass method with same name
Summary: Error when package-private method matches superclass method with same name
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: java (show other bugs)
Version: 3.4.0
: P2 normal
Target Milestone: 4.3.0
Assignee: Not yet assigned to anyone
URL:
Keywords: rejects-valid
: 14979 (view as bug list)
Depends on: 28067
Blocks:
  Show dependency treegraph
 
Reported: 2003-10-23 09:32 UTC by wynne
Modified: 2007-01-09 20:45 UTC (History)
4 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2005-07-04 10:16:22


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description wynne 2003-10-23 09:32:16 UTC
Using the MinGW build of GCC3.4 build 20031006 on win2k.
Received a compile error on code similar to the following:

package com.test;
public class A {
boolean myMethod();
}

package com.test.sub;
public class B {
void myMethod();
}

The compiler complains that the return types don't match.  This should be
acceptable since the two methods have package visiblity and the two classes are
in different packages.

Hope this is helpful.
Comment 1 Bryce McKinlay 2003-10-24 02:03:23 UTC
Confirmed on mainline/linux. 

The test-case isn't quite right however, here's a correct one:

package com.test;
public class A
{
  Object myMethod() {return null;}
}

package com.test.sub;
import com.test.*;
public class B extends A 
{
  void myMethod() {}
}
Comment 2 Bryce McKinlay 2004-05-05 15:32:52 UTC
*** Bug 14979 has been marked as a duplicate of this bug. ***
Comment 3 Tom Tromey 2007-01-09 20:45:56 UTC
All gcj front end bugs have been fixed by the gcj-eclipse branch merge.
I'm mass-closing the affected PRs.
If you believe one of these was closed in error, please reopen it
with a note explaining why.
Thanks.