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

Mon, 02 Sep 2013 22:38:36 +0100

author
vromero
date
Mon, 02 Sep 2013 22:38:36 +0100
changeset 2000
4a6acc42c3a1
parent 384
ed31953ca025
child 2525
2eb010b6cb22
permissions
-rw-r--r--

8016177: structural most specific and stuckness
Reviewed-by: jjg, vromero
Contributed-by: maurizio.cimadamore@oracle.com

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