I have a problem with generics in Java in combination with interface inheritance. Here is an exampe:
public interface Type0 { }
public interface Type1 extends Type0 {
void method();
}
public interface SomeInterface0<T extends Type0> {
T get();
}
public interface SomeInterface1<T extends Type1> extends SomeInterface0<T> { }
Now, when I try to use field of type SomeInterface1 without type parameter java comiler treats type of SomeInterface1.get() method result as Type0. And can't compile something like this:
...
SomeInterface1 si1;
...
si1.get().method();
So, why SomeInterface1<T extends Type1> has a default vlue for T = Type0 ?