core: fix anonymous class codegen

This commit is contained in:
Skylot
2013-12-20 23:22:27 +04:00
parent 1c60e5e315
commit 9f51cabf69
3 changed files with 25 additions and 8 deletions
@@ -63,6 +63,19 @@ public class TestInner extends AbstractTest {
}.run();
}
public String func3() {
return new Object() {
{
count += 7;
}
@Override
public String toString() {
count += 8;
return Integer.toString(count);
}
}.toString();
}
@SuppressWarnings("serial")
public static class MyException extends Exception {
public MyException(String str, Exception e) {
@@ -94,6 +107,8 @@ public class TestInner extends AbstractTest {
thread.join();
thread2.join();
return TestInner.count == 26;
assertEquals(func3(), "41");
return TestInner.count == 41;
}
}