langtools/test/tools/javac/generics/diamond/neg/Neg12.java
author mcimadamore
Fri, 18 Feb 2011 12:28:49 +0000
changeset 8431 21758b2bba40
permissions -rw-r--r--
7020043: Project Coin: diamond allowed on non-generic type Summary: Diamond oerator should be disallowed on non-generic class types (i.e. String) Reviewed-by: jjg
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
8431
21758b2bba40 7020043: Project Coin: diamond allowed on non-generic type
mcimadamore
parents:
diff changeset
     1
/*
21758b2bba40 7020043: Project Coin: diamond allowed on non-generic type
mcimadamore
parents:
diff changeset
     2
 * @test /nodynamiccopyright/
21758b2bba40 7020043: Project Coin: diamond allowed on non-generic type
mcimadamore
parents:
diff changeset
     3
 * @bug 7020043
21758b2bba40 7020043: Project Coin: diamond allowed on non-generic type
mcimadamore
parents:
diff changeset
     4
 *
21758b2bba40 7020043: Project Coin: diamond allowed on non-generic type
mcimadamore
parents:
diff changeset
     5
 * @summary  Project Coin: diamond allowed on non-generic type
21758b2bba40 7020043: Project Coin: diamond allowed on non-generic type
mcimadamore
parents:
diff changeset
     6
 * @author Rémi Forax
21758b2bba40 7020043: Project Coin: diamond allowed on non-generic type
mcimadamore
parents:
diff changeset
     7
 * @compile/fail/ref=Neg12.out Neg12.java -XDrawDiagnostics
21758b2bba40 7020043: Project Coin: diamond allowed on non-generic type
mcimadamore
parents:
diff changeset
     8
 *
21758b2bba40 7020043: Project Coin: diamond allowed on non-generic type
mcimadamore
parents:
diff changeset
     9
 */
21758b2bba40 7020043: Project Coin: diamond allowed on non-generic type
mcimadamore
parents:
diff changeset
    10
21758b2bba40 7020043: Project Coin: diamond allowed on non-generic type
mcimadamore
parents:
diff changeset
    11
class DiamondRaw {
21758b2bba40 7020043: Project Coin: diamond allowed on non-generic type
mcimadamore
parents:
diff changeset
    12
   public static void main(String[] args) {
21758b2bba40 7020043: Project Coin: diamond allowed on non-generic type
mcimadamore
parents:
diff changeset
    13
     String s = new String<>("foo");
21758b2bba40 7020043: Project Coin: diamond allowed on non-generic type
mcimadamore
parents:
diff changeset
    14
   }
21758b2bba40 7020043: Project Coin: diamond allowed on non-generic type
mcimadamore
parents:
diff changeset
    15
}