Test4.java revision 1265:f5dbd6895994
150476Speter/**
23079Sache * @test     /nodynamiccopyright/
317359Swosch * @bug      7062745 7157798
448663Syokota * @summary  Negative test of conflicting same-name methods inherited from multiple interfaces when parameter types not compatible
559158Sache * @compile/fail/ref=Test4.out -Werror -Xlint:unchecked -XDrawDiagnostics Test4.java
633274Syokota */
748129Syokota
855578Sacheimport java.util.Set;
948129Syokotaimport java.util.HashSet;
1017359Swosch
1186694Sacheinterface A { void m(Set<Integer> s); }
1286694Sacheinterface B { void m(Set<String> s); }
1343334Syokotainterface C { void m(Set<?> s); }
1432822Syokota
1549876Syokotainterface AB extends A, B {} //error
1617359Swosch
1771167Sacheinterface AC extends A, C {} //error
1843334Syokota
1940772Sjulianinterface D<T> { void m(Set<T> s); }
2040772Sjulian
2117359Swoschinterface AD extends A, D<Integer> {} //OK
2265187Sache
2378381Snyaninterface AD2 extends A, D<Number> {} //error
2427400Sache
2555078Sacheinterface CD<T> extends C, D<T> {} //error
2617359Swosch
2778042Sacheinterface E { <T> void m(Set<T> s); }
2842784Syokota
2988758Sacheinterface DE<T> extends D<T>, E {} //error
3031028Sache