author | phh |
Sat, 30 Nov 2019 14:33:05 -0800 | |
changeset 59330 | 5b96c12f909d |
parent 51101 | babe5786dea9 |
permissions | -rw-r--r-- |
5321
c8efe769cb3b
6939620: Switch to 'complex' diamond inference scheme
mcimadamore
parents:
diff
changeset
|
1 |
/* |
c8efe769cb3b
6939620: Switch to 'complex' diamond inference scheme
mcimadamore
parents:
diff
changeset
|
2 |
* @test /nodynamiccopyright/ |
29776
984a79b71cfe
8062373: Project Coin: diamond and anonymous classes
sadayapalam
parents:
8635
diff
changeset
|
3 |
* @bug 7020044 8062373 |
5321
c8efe769cb3b
6939620: Switch to 'complex' diamond inference scheme
mcimadamore
parents:
diff
changeset
|
4 |
* |
29776
984a79b71cfe
8062373: Project Coin: diamond and anonymous classes
sadayapalam
parents:
8635
diff
changeset
|
5 |
* @summary Check that diamond is not allowed with anonymous inner class expressions at source < 9 |
8635
383a416a2bdf
7020044: Project Coin: diamond erroneous allowed on some anonymous inner classes
mcimadamore
parents:
5321
diff
changeset
|
6 |
* @author Maurizio Cimadamore |
51101
babe5786dea9
8207248: Reduce incidence of compiler.warn.source.no.bootclasspath in javac tests
darcy
parents:
47216
diff
changeset
|
7 |
* @compile/fail/ref=Neg09c.out Neg09c.java -source 8 -XDrawDiagnostics -Xlint:-options |
5321
c8efe769cb3b
6939620: Switch to 'complex' diamond inference scheme
mcimadamore
parents:
diff
changeset
|
8 |
* |
c8efe769cb3b
6939620: Switch to 'complex' diamond inference scheme
mcimadamore
parents:
diff
changeset
|
9 |
*/ |
c8efe769cb3b
6939620: Switch to 'complex' diamond inference scheme
mcimadamore
parents:
diff
changeset
|
10 |
|
40504
0a01f6710c84
8078561: Error message should be generated once when -source 6 is specified
jlahoda
parents:
29776
diff
changeset
|
11 |
class Neg09c { |
8635
383a416a2bdf
7020044: Project Coin: diamond erroneous allowed on some anonymous inner classes
mcimadamore
parents:
5321
diff
changeset
|
12 |
class Member<X> {} |
383a416a2bdf
7020044: Project Coin: diamond erroneous allowed on some anonymous inner classes
mcimadamore
parents:
5321
diff
changeset
|
13 |
|
383a416a2bdf
7020044: Project Coin: diamond erroneous allowed on some anonymous inner classes
mcimadamore
parents:
5321
diff
changeset
|
14 |
void testQualified() { |
383a416a2bdf
7020044: Project Coin: diamond erroneous allowed on some anonymous inner classes
mcimadamore
parents:
5321
diff
changeset
|
15 |
Member<?> m1 = this.new Member<>() {}; |
383a416a2bdf
7020044: Project Coin: diamond erroneous allowed on some anonymous inner classes
mcimadamore
parents:
5321
diff
changeset
|
16 |
} |
5321
c8efe769cb3b
6939620: Switch to 'complex' diamond inference scheme
mcimadamore
parents:
diff
changeset
|
17 |
} |