test/langtools/tools/javac/generics/diamond/neg/Neg10.java
changeset 47216 71c04702a3d5
parent 15374 fb8f6acf09cc
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/langtools/tools/javac/generics/diamond/neg/Neg10.java	Tue Sep 12 19:03:39 2017 +0200
@@ -0,0 +1,18 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 6939620 7020044
+ *
+ * @summary  Check that 'complex' diamond can infer type that is too specific
+ * @author mcimadamore
+ * @compile/fail/ref=Neg10.out -source 7 -Xlint:-options Neg10.java -XDrawDiagnostics
+ * @compile Neg10.java -XDrawDiagnostics
+ *
+ */
+
+class Neg10 {
+    static class Foo<X> {
+        Foo(X x) {}
+    }
+
+    Foo<Number> fw = new Foo<>(1);
+}