langtools/test/tools/javac/generics/diamond/neg/Neg09b.java
author jlahoda
Tue, 16 Aug 2016 16:43:00 +0200
changeset 40504 0a01f6710c84
parent 29776 langtools/test/tools/javac/generics/diamond/neg/Neg09.java@984a79b71cfe
permissions -rw-r--r--
8078561: Error message should be generated once when -source 6 is specified Summary: Code to avoid duplicated errors about features not supported in the current source level moved to Log Reviewed-by: jjg
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
40504
0a01f6710c84 8078561: Error message should be generated once when -source 6 is specified
jlahoda
parents: 29776
diff changeset
     7
 * @compile/fail/ref=Neg09b.out Neg09b.java -source 8 -XDrawDiagnostics
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 Neg09b {
8635
383a416a2bdf 7020044: Project Coin: diamond erroneous allowed on some anonymous inner classes
mcimadamore
parents: 5321
diff changeset
    12
383a416a2bdf 7020044: Project Coin: diamond erroneous allowed on some anonymous inner classes
mcimadamore
parents: 5321
diff changeset
    13
    static class Nested<X> {}
5321
c8efe769cb3b 6939620: Switch to 'complex' diamond inference scheme
mcimadamore
parents:
diff changeset
    14
8635
383a416a2bdf 7020044: Project Coin: diamond erroneous allowed on some anonymous inner classes
mcimadamore
parents: 5321
diff changeset
    15
    void testSimple() {
383a416a2bdf 7020044: Project Coin: diamond erroneous allowed on some anonymous inner classes
mcimadamore
parents: 5321
diff changeset
    16
        Nested<?> m2 = new Nested<>() {};
383a416a2bdf 7020044: Project Coin: diamond erroneous allowed on some anonymous inner classes
mcimadamore
parents: 5321
diff changeset
    17
    }
383a416a2bdf 7020044: Project Coin: diamond erroneous allowed on some anonymous inner classes
mcimadamore
parents: 5321
diff changeset
    18
5321
c8efe769cb3b 6939620: Switch to 'complex' diamond inference scheme
mcimadamore
parents:
diff changeset
    19
}