author | darcy |
Thu, 12 Jul 2018 14:13:15 -0700 | |
changeset 51047 | 860a3648c494 |
parent 47216 | 71c04702a3d5 |
permissions | -rw-r--r-- |
9302
13a19cf713fd
7034019: ClassCastException in javac with conjunction types
mcimadamore
parents:
diff
changeset
|
1 |
/* |
13a19cf713fd
7034019: ClassCastException in javac with conjunction types
mcimadamore
parents:
diff
changeset
|
2 |
* @test /nodynamiccopyright/ |
13a19cf713fd
7034019: ClassCastException in javac with conjunction types
mcimadamore
parents:
diff
changeset
|
3 |
* @bug 7034019 |
13a19cf713fd
7034019: ClassCastException in javac with conjunction types
mcimadamore
parents:
diff
changeset
|
4 |
* @summary ClassCastException in javac with conjunction types |
13a19cf713fd
7034019: ClassCastException in javac with conjunction types
mcimadamore
parents:
diff
changeset
|
5 |
* |
13a19cf713fd
7034019: ClassCastException in javac with conjunction types
mcimadamore
parents:
diff
changeset
|
6 |
* @compile/fail/ref=T7034019c.out -XDrawDiagnostics T7034019c.java |
13a19cf713fd
7034019: ClassCastException in javac with conjunction types
mcimadamore
parents:
diff
changeset
|
7 |
*/ |
13a19cf713fd
7034019: ClassCastException in javac with conjunction types
mcimadamore
parents:
diff
changeset
|
8 |
|
13a19cf713fd
7034019: ClassCastException in javac with conjunction types
mcimadamore
parents:
diff
changeset
|
9 |
class T7034019c { |
13a19cf713fd
7034019: ClassCastException in javac with conjunction types
mcimadamore
parents:
diff
changeset
|
10 |
interface A { |
13a19cf713fd
7034019: ClassCastException in javac with conjunction types
mcimadamore
parents:
diff
changeset
|
11 |
abstract <T extends Number> T foo(); |
13a19cf713fd
7034019: ClassCastException in javac with conjunction types
mcimadamore
parents:
diff
changeset
|
12 |
} |
13a19cf713fd
7034019: ClassCastException in javac with conjunction types
mcimadamore
parents:
diff
changeset
|
13 |
|
13a19cf713fd
7034019: ClassCastException in javac with conjunction types
mcimadamore
parents:
diff
changeset
|
14 |
interface B { |
13a19cf713fd
7034019: ClassCastException in javac with conjunction types
mcimadamore
parents:
diff
changeset
|
15 |
abstract <T> T foo(); |
13a19cf713fd
7034019: ClassCastException in javac with conjunction types
mcimadamore
parents:
diff
changeset
|
16 |
} |
13a19cf713fd
7034019: ClassCastException in javac with conjunction types
mcimadamore
parents:
diff
changeset
|
17 |
|
13a19cf713fd
7034019: ClassCastException in javac with conjunction types
mcimadamore
parents:
diff
changeset
|
18 |
static class C<T extends A & B> { |
13a19cf713fd
7034019: ClassCastException in javac with conjunction types
mcimadamore
parents:
diff
changeset
|
19 |
void test(T x) { |
13a19cf713fd
7034019: ClassCastException in javac with conjunction types
mcimadamore
parents:
diff
changeset
|
20 |
x.foo(); |
13a19cf713fd
7034019: ClassCastException in javac with conjunction types
mcimadamore
parents:
diff
changeset
|
21 |
} |
13a19cf713fd
7034019: ClassCastException in javac with conjunction types
mcimadamore
parents:
diff
changeset
|
22 |
} |
13a19cf713fd
7034019: ClassCastException in javac with conjunction types
mcimadamore
parents:
diff
changeset
|
23 |
} |