7060926: Attr.PostAttrAnalyzer misses a case
authorjjg
Thu, 30 Jun 2011 12:00:53 -0700
changeset 10187 983f0e987540
parent 10186 31a86b7e18ca
child 10188 cdd8666ce536
child 10189 57268b86d4da
7060926: Attr.PostAttrAnalyzer misses a case Reviewed-by: mcimadamore
langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java
langtools/test/tools/javac/failover/FailOver15.java
langtools/test/tools/javac/failover/FailOver15.out
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java	Fri Jun 24 13:52:14 2011 -0700
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java	Thu Jun 30 12:00:53 2011 -0700
@@ -3388,6 +3388,13 @@
         }
 
         @Override
+        public void visitAssignop(JCAssignOp that) {
+            if (that.operator == null)
+                that.operator = new OperatorSymbol(names.empty, syms.unknownType, -1, syms.noSymbol);
+            super.visitAssignop(that);
+        }
+
+        @Override
         public void visitBinary(JCBinary that) {
             if (that.operator == null)
                 that.operator = new OperatorSymbol(names.empty, syms.unknownType, -1, syms.noSymbol);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/failover/FailOver15.java	Thu Jun 30 12:00:53 2011 -0700
@@ -0,0 +1,19 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 6970584 7060926
+ * @summary Attr.PostAttrAnalyzer misses a case
+ *
+ * @compile/fail/ref=FailOver15.out -XDrawDiagnostics -XDshouldStopPolicy=FLOW -XDdev FailOver15.java
+ */
+
+class Test {
+    void m() {
+        new UnknownClass<String, Void>() {
+            public String getString() {
+                String s = "";
+                s += "more";
+                return s;
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/langtools/test/tools/javac/failover/FailOver15.out	Thu Jun 30 12:00:53 2011 -0700
@@ -0,0 +1,4 @@
+FailOver15.java:17:10: compiler.err.expected: ';'
+FailOver15.java:11:13: compiler.err.cant.resolve.location: kindname.class, UnknownClass, , , (compiler.misc.location: kindname.class, Test, null)
+2 errors
+