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

Thu, 25 Aug 2011 17:18:25 -0700

author
schien
date
Thu, 25 Aug 2011 17:18:25 -0700
changeset 1067
f497fac86cf9
parent 384
ed31953ca025
child 2525
2eb010b6cb22
permissions
-rw-r--r--

Added tag jdk8-b02 for changeset b3c059de2a61

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