class Y <T extends Z>{
Z foo() {
return null;
}
}
class Z { }
public class HelloWorld {
public <
M extends Y<T>,
T extends Z
>
M mp(T template_mp_type, boolean v) {
return null;
}
@SuppressWarnings("unchecked")
public <
M extends Y<T>,
T extends Z
>
M mp(M template_mp, boolean v) {
return mp(template_mp.foo(), v); // bound mismatch
}
}
Sorry for single name classes, I just wanted to generalize problem. I know if I make some changes in code that it will compile and work, my problem is why it doesn’t work now? I wonder is this a problem with eclipse jdt compiler or it is a problem in my code and it can’t be compiled. I also tried to use openJDK 1.6.0 build 9 on centOS and it failed to compile.
First of all, thank you very much jurn. Now I think that your last post explains everything and that code is not valid. And yes, parameter T is unused intentional, this is some test code for a features in Java so I played with variety of combination of code examples with parameter types.