langtools/test/tools/javac/generics/CatchTyparam.java
author mcimadamore
Fri, 09 Jan 2015 15:49:42 +0000
changeset 28337 0b46fb7be75a
parent 25693 b9f1261db3b4
permissions -rw-r--r--
8043741: VerifyError due to missing checkcast Summary: Proto-type is not set correctly for NULLCHK synthetic trees Reviewed-by: mcimadamore Contributed-by: srikanth.adayapalam@oracle.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
/*
25693
b9f1261db3b4 8048836: .out files for generics tests in tools/javac dir
sogoel
parents: 5520
diff changeset
     2
 * @test /nodynamiccopyright/
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     3
 * @bug 5057445
06bc494ca11e Initial load
duke
parents:
diff changeset
     4
 * @summary javac allows catching type parameter
06bc494ca11e Initial load
duke
parents:
diff changeset
     5
 * @author gafter
06bc494ca11e Initial load
duke
parents:
diff changeset
     6
 *
25693
b9f1261db3b4 8048836: .out files for generics tests in tools/javac dir
sogoel
parents: 5520
diff changeset
     7
 * @compile/fail/ref=CatchTyparam.out -XDrawDiagnostics  CatchTyparam.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 J {
06bc494ca11e Initial load
duke
parents:
diff changeset
    11
    <T extends Error, U extends Error> void foo() {
06bc494ca11e Initial load
duke
parents:
diff changeset
    12
        try {
06bc494ca11e Initial load
duke
parents:
diff changeset
    13
            int i = 12;
06bc494ca11e Initial load
duke
parents:
diff changeset
    14
        } catch (T ex) {
06bc494ca11e Initial load
duke
parents:
diff changeset
    15
        } catch (U ex) {
06bc494ca11e Initial load
duke
parents:
diff changeset
    16
        }
06bc494ca11e Initial load
duke
parents:
diff changeset
    17
    }
06bc494ca11e Initial load
duke
parents:
diff changeset
    18
}