Menu

#108 [Generics] No bridge method is generated

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

In the below class Bug18, a bridge method with the signature
public Object getValue();
should be generated which is not done, thus leading to an AbstractMethodError when running the example.
Note that the MultiJava compiler does have a mechanism to insert bridge methods but it seems not to work in this example.

=======================================
interface ValueHolder<T> {
T getValue();
}

public class Bug18 implements ValueHolder<String> {
// No bridge method is inserted
public String getValue() {
return "the value";
}

public static void main(String[] args) {
ValueHolder<String> v = new Bug18();
System.out.println(v.getValue());
}
}
=======================================

Discussion


Log in to post a comment.

Auth0 Logo