Bug 9985 - Built in compiler will sometimes not allow Object method calls on Interfaces
Summary: Built in compiler will sometimes not allow Object method calls on Interfaces
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P1 major (vote)
Target Milestone: 2.0 M4   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 10166 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-02-18 14:24 EST by John Wilson CLA
Modified: 2003-02-17 08:19 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Wilson CLA 2002-02-18 14:24:30 EST
If an Interface has a method with the same name as an Object method but a 
different signature then the built in compiler will not allow the Object method 
to be called on the Interface.

The following is an example of this:

public interface Element {
  String toString(Object o);
}

class Impl implements Element {
  public String toString(final Object o) { return null; }
  
  public void bug() {
  final Element e = new Impl();
  
    e.getClass();	// This is OK
    e.toString(); // This gives an error and should not
  }
}
Comment 1 Philipe Mulet CLA 2002-02-19 00:05:19 EST
Assessed.
Comment 2 Philipe Mulet CLA 2002-02-25 05:35:24 EST
Interface lookup did exclude Object in case a selector match was found. Got rid 
of this behavior.
Fixed
Comment 3 Philipe Mulet CLA 2002-02-25 16:55:44 EST
*** Bug 10166 has been marked as a duplicate of this bug. ***