langtools/test/tools/javac/cast/5064736/T5064736.java
author sogoel
Thu, 05 Jun 2014 10:44:38 -0700
changeset 24796 f940af3221e2
parent 5520 86e4b9a9da40
permissions -rw-r--r--
8044064: Group 1: create .out files for cast and capture negative tests in tools/javac dir Reviewed-by: jjg
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
/*
24796
f940af3221e2 8044064: Group 1: create .out files for cast and capture negative tests in tools/javac dir
sogoel
parents: 5520
diff changeset
     2
 * @test    /nodynamiccopyright/
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     3
 * @bug     5064736
06bc494ca11e Initial load
duke
parents:
diff changeset
     4
 * @summary Incompatible types are cast without error
24796
f940af3221e2 8044064: Group 1: create .out files for cast and capture negative tests in tools/javac dir
sogoel
parents: 5520
diff changeset
     5
 * @compile/fail/ref=T5064736.out -XDrawDiagnostics  T5064736.java
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     6
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
     7
06bc494ca11e Initial load
duke
parents:
diff changeset
     8
public class T5064736 {
06bc494ca11e Initial load
duke
parents:
diff changeset
     9
    class A {}
06bc494ca11e Initial load
duke
parents:
diff changeset
    10
    class B extends A {}
06bc494ca11e Initial load
duke
parents:
diff changeset
    11
06bc494ca11e Initial load
duke
parents:
diff changeset
    12
    public class Foo<T> {
06bc494ca11e Initial load
duke
parents:
diff changeset
    13
        public <U extends B> void foo(Foo<? super A> param) {
06bc494ca11e Initial load
duke
parents:
diff changeset
    14
            Foo<U> foo = (Foo<U>)param;
06bc494ca11e Initial load
duke
parents:
diff changeset
    15
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
    16
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    17
}