check method signatures equality by erasure; do not check method names for constructors.

note that erasure of type parameter is erasure of its left bound (jls), so erasure (T extends A & B) != erasure (T extends B & A)
e.g. IDEA-74409
This commit is contained in:
anna
2011-09-23 08:00:09 +02:00
parent 83931c053e
commit 18b6fe1bd4
6 changed files with 36 additions and 23 deletions
@@ -16,9 +16,20 @@
import java.io.*;
class Test {
interface InterfA {
<error descr="'foo(T)' is already defined in 'Test.InterfA'"><T extends Cloneable & Iterable> void foo(T x)</error>;
<T extends Cloneable & Iterable> void foo(T x);
<error descr="'foo(T)' is already defined in 'Test.InterfA'"><T extends Iterable & Cloneable> void foo(T x)</error>;
<T extends Iterable & Cloneable> void foo(T x);
}
class ANotSame {
<T extends Cloneable & Iterable> void foo(T x){}
<T extends Iterable & Cloneable> void foo(T x){}
}
class BNotSame extends ANotSame {
@Override
<T extends Cloneable & Iterable> void foo(T x){}
}
abstract class A<T extends Throwable> {