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

changeset 0
959103a6100f
child 2525
2eb010b6cb22
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/test/tools/javac/cast/6557182/T6557182.java	Wed Apr 27 01:34:52 2016 +0800
     1.3 @@ -0,0 +1,18 @@
     1.4 +/*
     1.5 + * @test /nodynamiccopyright/
     1.6 + * @author Maurizio Cimadamore
     1.7 + * @bug     6557182
     1.8 + * @summary  Unchecked warning *and* inconvertible types
     1.9 + * @compile/fail/ref=T6557182.out -XDrawDiagnostics -Xlint:unchecked T6557182.java
    1.10 + */
    1.11 +
    1.12 +class T6557182 {
    1.13 +
    1.14 +    <T extends Number & Comparable<String>> void test1(T t) {
    1.15 +        Comparable<Integer> ci = (Comparable<Integer>) t;
    1.16 +    }
    1.17 +
    1.18 +    <T extends Number & Comparable<? extends Number>> void test2(T t) {
    1.19 +        Comparable<Integer> ci = (Comparable<Integer>) t;
    1.20 +    }
    1.21 +}

mercurial