langtools/test/tools/javac/generics/diamond/neg/Neg18.java
author sadayapalam
Mon, 30 Mar 2015 17:09:14 +0530
changeset 29776 984a79b71cfe
permissions -rw-r--r--
8062373: Project Coin: diamond and anonymous classes Summary: Allow diamond inference in combination with anonymous class instance creation Reviewed-by: mcimadamore, vromero Contributed-by: srikanth.adayapalam@oracle.com, maurizio.cimadamore@oracle.com
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
}