rewrite of closure capturing for object literals

This commit is contained in:
Alex Tkachman
2011-11-22 12:35:42 +02:00
parent ed4dc03b16
commit efceb12f3b
27 changed files with 435 additions and 133 deletions
@@ -24,7 +24,7 @@ public class ClassGenTest extends CodegenTestCase {
loadFile("classes/inheritingFromArrayList.jet");
final Class aClass = loadClass("Foo", generateClassesInFile());
checkInterface(aClass, List.class);
assertInstanceOf(aClass.newInstance(), List.class);
}
public void testInheritanceAndDelegation_DelegatingDefaultConstructorProperties() throws Exception {
@@ -47,13 +47,6 @@ public class ClassGenTest extends CodegenTestCase {
blackBoxFile("classes/rightHandOverride.jet");
}
private static void checkInterface(Class aClass, Class ifs) {
for (Class anInterface : aClass.getInterfaces()) {
if (anInterface == ifs) return;
}
fail(aClass.getName() + " must have " + ifs.getName() + " in its interfaces");
}
public void testNewInstanceExplicitConstructor() throws Exception {
loadFile("classes/newInstanceDefaultConstructor.jet");
System.out.println(generateToText());