735N/A/*
735N/A * @test /nodynamiccopyright/
735N/A * @author mcimadamore
735N/A * @bug 6714835
735N/A * @summary Safe cast is rejected (with warning) by javac
735N/A * @compile/fail/ref=T6714835.out -Xlint:unchecked -Werror -XDrawDiagnostics T6714835.java
735N/A */
735N/A
735N/Aimport java.util.*;
735N/A
735N/Aclass T6714835 {
735N/A void cast1(Iterable<? extends Integer> x) {
735N/A Collection<? extends Number> x1 = (Collection<? extends Number>)x; //ok
735N/A Collection<? super Integer> x2 = (Collection<? super Integer>)x; //warn
735N/A }
735N/A
735N/A void cast2(Iterable<? super Number> x) {
735N/A Collection<? super Integer> x1 = (Collection<? super Integer>)x; //ok
735N/A Collection<? extends Number> x2 = (Collection<? extends Number>)x; //warn
735N/A }
735N/A}