changeset 1038:ceb7ca04b7eb

7060926: Attr.PostAttrAnalyzer misses a case Reviewed-by: mcimadamore
author jjh
date Thu, 04 Aug 2011 14:25:02 -0700
parents 102e79e1e38f
children 2f2ac80b6836
files src/share/classes/com/sun/tools/javac/comp/Attr.java test/tools/javac/failover/FailOver15.java test/tools/javac/failover/FailOver15.out
diffstat 3 files changed, 29 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/com/sun/tools/javac/comp/Attr.java	Thu Jul 21 12:40:14 2011 -0700
+++ b/src/share/classes/com/sun/tools/javac/comp/Attr.java	Thu Aug 04 14:25:02 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/test/tools/javac/failover/FailOver15.java	Thu Aug 04 14:25:02 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/test/tools/javac/failover/FailOver15.out	Thu Aug 04 14:25:02 2011 -0700
@@ -0,0 +1,3 @@
+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