test/tools/javac/cast/6557182/T6557182.java

Thu, 27 Aug 2009 11:08:27 -0700

author
jjg
date
Thu, 27 Aug 2009 11:08:27 -0700
changeset 384
ed31953ca025
parent 211
4542977c959e
child 2525
2eb010b6cb22
permissions
-rw-r--r--

6875336: some tests should use /nodynamiccopyright/
Reviewed-by: darcy

mcimadamore@211 1 /*
jjg@384 2 * @test /nodynamiccopyright/
mcimadamore@211 3 * @author Maurizio Cimadamore
mcimadamore@211 4 * @bug 6557182
mcimadamore@211 5 * @summary Unchecked warning *and* inconvertible types
mcimadamore@211 6 * @compile/fail/ref=T6557182.out -XDrawDiagnostics -Xlint:unchecked T6557182.java
mcimadamore@211 7 */
mcimadamore@211 8
mcimadamore@211 9 class T6557182 {
mcimadamore@211 10
mcimadamore@211 11 <T extends Number & Comparable<String>> void test1(T t) {
mcimadamore@211 12 Comparable<Integer> ci = (Comparable<Integer>) t;
mcimadamore@211 13 }
mcimadamore@211 14
mcimadamore@211 15 <T extends Number & Comparable<? extends Number>> void test2(T t) {
mcimadamore@211 16 Comparable<Integer> ci = (Comparable<Integer>) t;
mcimadamore@211 17 }
mcimadamore@211 18 }

mercurial