test/tools/javac/generics/diamond/neg/Neg06.java

Wed, 27 Jul 2011 19:01:08 +0100

author
mcimadamore
date
Wed, 27 Jul 2011 19:01:08 +0100
changeset 1060
d5f33267a06d
parent 914
ca32f2986301
child 2525
2eb010b6cb22
permissions
-rw-r--r--

7046778: Project Coin: problem with diamond and member inner classes
Summary: Diamond inference generates spurious error messages when target type is a member inner class
Reviewed-by: jjg

mcimadamore@537 1 /*
mcimadamore@537 2 * @test /nodynamiccopyright/
mcimadamore@914 3 * @bug 6939620 7020044
mcimadamore@537 4 *
mcimadamore@914 5 * @summary Check that diamond works where LHS is supertype of RHS (nilary constructor)
mcimadamore@537 6 * @author mcimadamore
mcimadamore@537 7 * @compile/fail/ref=Neg06.out Neg06.java -XDrawDiagnostics
mcimadamore@537 8 *
mcimadamore@537 9 */
mcimadamore@537 10
mcimadamore@537 11 class Neg06 {
mcimadamore@537 12
mcimadamore@537 13 static class CSuperFoo<X> {}
mcimadamore@537 14 static class CFoo<X extends Number> extends CSuperFoo<X> {}
mcimadamore@537 15
mcimadamore@537 16 CSuperFoo<String> csf1 = new CFoo<>();
mcimadamore@537 17 }

mercurial