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

changeset 0
959103a6100f
child 2525
2eb010b6cb22
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/test/tools/javac/generics/diamond/neg/Neg11.java	Wed Apr 27 01:34:52 2016 +0800
     1.3 @@ -0,0 +1,18 @@
     1.4 +/*
     1.5 + * @test /nodynamiccopyright/
     1.6 + * @bug 6939620 7020044
     1.7 + *
     1.8 + * @summary  Check that unresolved symbols doesn't cause spurious diamond diagnostics
     1.9 + * @author mcimadamore
    1.10 + * @compile/fail/ref=Neg11.out Neg11.java -XDrawDiagnostics
    1.11 + *
    1.12 + */
    1.13 +
    1.14 +class Neg11 {
    1.15 +
    1.16 +    void test() {
    1.17 +        class Foo<X extends Number> { }
    1.18 +        Foo<?> f1 = new UndeclaredName<>(); //this is deliberate: aim is to test erroneous path
    1.19 +        Foo<?> f2 = new UndeclaredName<>() {}; //this is deliberate: aim is to test erroneous path
    1.20 +    }
    1.21 +}

mercurial