langtools/test/tools/javac/cast/6557182/T6557182.java
author peterz
Fri, 28 May 2010 13:32:40 +0400
changeset 5594 3db39773da2e
parent 3766 7e2df99e9223
permissions -rw-r--r--
6954231: SynthTextPaneUI.installUI() doesn't set component to opaque even if prop was not set by client progr Reviewed-by: alexp

/*
 * @test /nodynamiccopyright/
 * @author Maurizio Cimadamore
 * @bug     6557182
 * @summary  Unchecked warning *and* inconvertible types
 * @compile/fail/ref=T6557182.out -XDrawDiagnostics -Xlint:unchecked T6557182.java
 */

class T6557182 {

    <T extends Number & Comparable<String>> void test1(T t) {
        Comparable<Integer> ci = (Comparable<Integer>) t;
    }

    <T extends Number & Comparable<? extends Number>> void test2(T t) {
        Comparable<Integer> ci = (Comparable<Integer>) t;
    }
}