Description
This fails to compile:
---
interface I {
Object m(Iterable l);
}
interface J<S> {
S m(Iterable<String> l);
}
interface K<T> {
T m(Iterable<String> l);
}
interface Functional<S,T> extends I, J<S>, K<T> {}
---
On the other hand, this compiles fine:
---
interface Parent<T> {
T m(Iterable<String> i);
}
interface Child<T> extends Parent<T> {
Object m(Iterable i);
}
---
This compiles fine, too:
---
interface I {
int[] m(Iterable l);
}
interface J<S> {
java.io.Serializable m(Iterable<String> l);
}
interface K<T> {
Cloneable m(Iterable<String> l);
}
interface Functional<S,T> extends I, J<S>, K<T> {}
---
Problem appears to be that javac is looking for pairwise return-type-substitutable when it uses the rule "R1 = |R2|", while JLS 9.4.1 just says that there needs to be one method RTS for all the others.
---
interface I {
Object m(Iterable l);
}
interface J<S> {
S m(Iterable<String> l);
}
interface K<T> {
T m(Iterable<String> l);
}
interface Functional<S,T> extends I, J<S>, K<T> {}
---
On the other hand, this compiles fine:
---
interface Parent<T> {
T m(Iterable<String> i);
}
interface Child<T> extends Parent<T> {
Object m(Iterable i);
}
---
This compiles fine, too:
---
interface I {
int[] m(Iterable l);
}
interface J<S> {
java.io.Serializable m(Iterable<String> l);
}
interface K<T> {
Cloneable m(Iterable<String> l);
}
interface Functional<S,T> extends I, J<S>, K<T> {}
---
Problem appears to be that javac is looking for pairwise return-type-substitutable when it uses the rule "R1 = |R2|", while JLS 9.4.1 just says that there needs to be one method RTS for all the others.