method hierarchy: don't merge methods with return types which are not substitutable (IDEA-57393)

This commit is contained in:
Anna Kozlova
2015-12-14 10:30:48 +01:00
parent 13fac3d5e2
commit 8edd7a4cf5
4 changed files with 78 additions and 2 deletions
@@ -0,0 +1,8 @@
interface I<T, S extends Throwable> {
int foo(T x);
void foo(S x);
}
class A implements I<Throwable, Throwable>{
public <error descr="'foo(Throwable)' in 'A' clashes with 'foo(T)' in 'I'; attempting to use incompatible return type">void</error> foo(Throwable x) { }
}