langtools/test/tools/javac/cast/5064736/T5064736.java
author hseigel
Wed, 02 Mar 2016 23:48:41 +0000
changeset 36397 c487ced7231c
parent 24796 f940af3221e2
permissions -rw-r--r--
Merge
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
}