-
Bug
-
Resolution: Fixed
-
P4
-
1.4.0
-
beta2
-
generic
-
solaris_7
-
Verified
This is a bug in the jsr14 prototype compiler.
frog$ cat -n T.java
1 interface Collection<E> {
2 <T> T[] toArray(T[] a);
3 }
4
5 interface Set<E> extends Collection<E> {
6 <T> T[] toArray(T[] a);
7 }
8
9 interface SortedSet<E> extends Set<E> {
10 }
11
12 class TreeSet<E> {
13 public void addAll(Collection<E> c) {
14 if (c instanceof SortedSet<E>) {}
15 }
16 }
frog$ make
/java/jdk/ws/tools/jsr14/build/solaris-sparc/bin/javac -gj *.java
T.java:14: interfaces Collection<E> and SortedSet<E> are incompatible; both define toArray(T[]), but with different return type
if (c instanceof SortedSet<E>) {}
^
1 error
*** Error code 1
make: Fatal error: Command failed for target `all'
frog$
frog$ cat -n T.java
1 interface Collection<E> {
2 <T> T[] toArray(T[] a);
3 }
4
5 interface Set<E> extends Collection<E> {
6 <T> T[] toArray(T[] a);
7 }
8
9 interface SortedSet<E> extends Set<E> {
10 }
11
12 class TreeSet<E> {
13 public void addAll(Collection<E> c) {
14 if (c instanceof SortedSet<E>) {}
15 }
16 }
frog$ make
/java/jdk/ws/tools/jsr14/build/solaris-sparc/bin/javac -gj *.java
T.java:14: interfaces Collection<E> and SortedSet<E> are incompatible; both define toArray(T[]), but with different return type
if (c instanceof SortedSet<E>) {}
^
1 error
*** Error code 1
make: Fatal error: Command failed for target `all'
frog$