Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.4.3
-
None
-
Windows, Java 8.
Description
Suppose X is an interface and Y an interface such that Y extends X
The following code throws a compilation error (the outer class is annotated as @CompileStatic).
Set<X> set = new HashSet<X>()
Set<Y> toAdd = ......
set.addAll(toAdd)
However, the following works, which to me is inconsistent:
Set<X> set = new HashSet<X>() Set<Y> toAdd = ...... for(Y y in toAdd) { set.add(y) }
Attachments
Issue Links
- links to