File: Test4.java

package info (click to toggle)
libnb-javaparser-java 7.4-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch
  • size: 35,940 kB
  • ctags: 55,696
  • sloc: java: 264,137; xml: 2,781; sh: 1,135; makefile: 425
file content (29 lines) | stat: -rw-r--r-- 782 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/**
 * @test     /nodynamiccopyright/
 * @bug      7062745 7157798
 * @summary  Negative test of conflicting same-name methods inherited from multiple interfaces when parameter types not compatible
 * @compile/fail/ref=Test4.out -Werror -Xlint:unchecked -XDrawDiagnostics Test4.java
 */

import java.util.Set;
import java.util.HashSet;

interface A { void m(Set<Integer> s); }
interface B { void m(Set<String> s); }
interface C { void m(Set<?> s); }

interface AB extends A, B {} //error

interface AC extends A, C {} //error

interface D<T> { void m(Set<T> s); }

interface AD extends A, D<Integer> {} //OK

interface AD2 extends A, D<Number> {} //error

interface CD<T> extends C, D<T> {} //error

interface E { <T> void m(Set<T> s); }

interface DE<T> extends D<T>, E {} //error