test/langtools/tools/javac/generics/diamond/neg/Neg18.java
author erikj
Tue, 12 Sep 2017 19:03:39 +0200
changeset 47216 71c04702a3d5
parent 29776 langtools/test/tools/javac/generics/diamond/neg/Neg18.java@984a79b71cfe
permissions -rw-r--r--
8187443: Forest Consolidation: Move files to unified layout Reviewed-by: darcy, ihse
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
29776
984a79b71cfe 8062373: Project Coin: diamond and anonymous classes
sadayapalam
parents:
diff changeset
     1
/*
984a79b71cfe 8062373: Project Coin: diamond and anonymous classes
sadayapalam
parents:
diff changeset
     2
 * @test /nodynamiccopyright/
984a79b71cfe 8062373: Project Coin: diamond and anonymous classes
sadayapalam
parents:
diff changeset
     3
 * @bug 8062373
984a79b71cfe 8062373: Project Coin: diamond and anonymous classes
sadayapalam
parents:
diff changeset
     4
 * @summary Test that inaccessible vararg element type triggers an error during diamond inferred anonymous class instance creation.
984a79b71cfe 8062373: Project Coin: diamond and anonymous classes
sadayapalam
parents:
diff changeset
     5
 * @compile/fail/ref=Neg18.out Neg18.java -XDrawDiagnostics
984a79b71cfe 8062373: Project Coin: diamond and anonymous classes
sadayapalam
parents:
diff changeset
     6
 */
984a79b71cfe 8062373: Project Coin: diamond and anonymous classes
sadayapalam
parents:
diff changeset
     7
984a79b71cfe 8062373: Project Coin: diamond and anonymous classes
sadayapalam
parents:
diff changeset
     8
import java.util.Collections;
984a79b71cfe 8062373: Project Coin: diamond and anonymous classes
sadayapalam
parents:
diff changeset
     9
import pkg.Neg18_01;
984a79b71cfe 8062373: Project Coin: diamond and anonymous classes
sadayapalam
parents:
diff changeset
    10
984a79b71cfe 8062373: Project Coin: diamond and anonymous classes
sadayapalam
parents:
diff changeset
    11
class Neg18 {
984a79b71cfe 8062373: Project Coin: diamond and anonymous classes
sadayapalam
parents:
diff changeset
    12
984a79b71cfe 8062373: Project Coin: diamond and anonymous classes
sadayapalam
parents:
diff changeset
    13
   public static void main(String[] args) {
984a79b71cfe 8062373: Project Coin: diamond and anonymous classes
sadayapalam
parents:
diff changeset
    14
        new Neg18_01<>() {};
984a79b71cfe 8062373: Project Coin: diamond and anonymous classes
sadayapalam
parents:
diff changeset
    15
   }
984a79b71cfe 8062373: Project Coin: diamond and anonymous classes
sadayapalam
parents:
diff changeset
    16
}