7060926: Attr.PostAttrAnalyzer misses a case

Reviewed-by: mcimadamore
This commit is contained in:
Jonathan Gibbons 2011-06-30 12:00:53 -07:00
parent faf515b31f
commit 00fd0bdcfd
3 changed files with 30 additions and 0 deletions

View File

@ -3387,6 +3387,13 @@ public class Attr extends JCTree.Visitor {
super.visitNewClass(that);
}
@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)

View File

@ -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;
}
}
}
}

View File

@ -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