Menu

#109 [Generics] Problem with bridge methods and interfaces

Self_Reported
open
nobody
5
2012-11-27
2006-11-16
No

If (and only if :-) the below interface is compiled with the generics flag "-G", MultiJava complains about some problem generating a bridge method. This only happens if the method is declared inside an interface and the method is one of the methods present in java.lang.Object.

I guess no bridge method should be generated for an interface at all but I'm not sure what the problem is. The concrete error produced by MultiJava is:
File "Bug17.java", line 3, character 15 error: "Bug17.toString( )" will generate a bridge method that has signature with but does not override method "java.lang.Object.toString( )" [Generic MultiJava]

===================================
public interface Bug17 {
// Must be method present in java.lang.Object!
String toString();
}
===================================

Discussion


Log in to post a comment.

Auth0 Logo