langtools/test/tools/javac/generics/wildcards/neg/ParamCast.java
author sogoel
Fri, 15 May 2015 18:03:51 -0700
changeset 30726 43e5997e0baf
parent 5520 86e4b9a9da40
permissions -rw-r--r--
8075166: Group 14d: golden files for tests in tools/javac/generics/wildcards dir Reviewed-by: jjg
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
/*
30726
43e5997e0baf 8075166: Group 14d: golden files for tests in tools/javac/generics/wildcards dir
sogoel
parents: 5520
diff changeset
     2
 * @test /nodynamiccopyright/
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     3
 * @bug 4916567
30726
43e5997e0baf 8075166: Group 14d: golden files for tests in tools/javac/generics/wildcards dir
sogoel
parents: 5520
diff changeset
     4
 * @summary integrate improved wildcard substitution from CPH
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     5
 * @author gafter
06bc494ca11e Initial load
duke
parents:
diff changeset
     6
 *
30726
43e5997e0baf 8075166: Group 14d: golden files for tests in tools/javac/generics/wildcards dir
sogoel
parents: 5520
diff changeset
     7
 * @compile/fail/ref=ParamCast.out -XDrawDiagnostics ParamCast.java
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     8
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
     9
06bc494ca11e Initial load
duke
parents:
diff changeset
    10
class A<T> {}
06bc494ca11e Initial load
duke
parents:
diff changeset
    11
class B<S, T> extends A<T> {}
06bc494ca11e Initial load
duke
parents:
diff changeset
    12
06bc494ca11e Initial load
duke
parents:
diff changeset
    13
class Main {
06bc494ca11e Initial load
duke
parents:
diff changeset
    14
    void f(A<String> as) {
06bc494ca11e Initial load
duke
parents:
diff changeset
    15
        Object o = (B<?, Integer>) as;
06bc494ca11e Initial load
duke
parents:
diff changeset
    16
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    17
}