lazy initialization of classes

This commit is contained in:
Alex Tkachman
2011-11-01 17:11:06 +01:00
parent 503f1cf94d
commit 93d5a3b5ed
3 changed files with 131 additions and 58 deletions
@@ -59,4 +59,14 @@ public class VarArgTest extends CodegenTestCase {
assertTrue(((String[])res).length == 1);
assertTrue(((String[])res)[0].equals("239"));
}
public void testArrayT () throws InvocationTargetException, IllegalAccessException {
loadText("fun test() = _array(2, 4); fun <T> _array(vararg elements : T) = elements");
System.out.println(generateToText());
final Method main = generateFunction();
Object res = main.invoke(null, new Object[]{});
assertTrue(((Integer[])res).length == 2);
assertTrue(((Integer[])res)[0].equals(2));
assertTrue(((Integer[])res)[1].equals(4));
}
}