Mercurial > hg > icedtea8-forest > langtools
changeset 1080:858ae8fec72f
7060926: Attr.PostAttrAnalyzer misses a case
Reviewed-by: mcimadamore
author | jjg |
---|---|
date | Thu, 30 Jun 2011 12:00:53 -0700 |
parents | f74e4269a50a |
children | 469e3bec9b27 b0909f992710 |
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, 30 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/share/classes/com/sun/tools/javac/comp/Attr.java Fri Jun 24 13:52:14 2011 -0700 +++ b/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/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/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 +