Merge remote branch 'origin/master'

This commit is contained in:
Andrey Breslav
2011-12-01 22:34:04 +03:00
2 changed files with 20 additions and 0 deletions
@@ -1307,6 +1307,9 @@ public class ExpressionCodegen extends JetVisitor<StackValue, StackValue> {
else if(type.getSort() == Type.DOUBLE) {
v.aconst(0d);
}
else if(type.getSort() == Type.LONG) {
v.aconst(0l);
}
else {
v.iconst(0);
}
@@ -284,4 +284,21 @@ public class PrimitiveTypesTest extends CodegenTestCase {
public void testKt518 () throws Exception {
blackBoxFile("regressions/kt518.jet");
}
public void testKt665() throws Exception {
loadText("fun f(x: Long, zzz: Long = 1): Long\n" +
"{\n" +
" return if (x <= 1) zzz\n" +
" else f(x-1, x*zzz)\n" +
"}\n" +
"\n" +
"fun box() : String\n" +
"{\n" +
" val six: Long = 6;\n" +
" System.out?.println(f(six))\n" +
" return \"OK\"" +
"}");
System.out.println(generateToText());
blackBox();
}
}