This commit is contained in:
Alex Tkachman
2011-10-07 12:18:15 +02:00
parent b6fbbd84f5
commit 79ba46700e
2 changed files with 10 additions and 0 deletions
@@ -317,6 +317,9 @@ public class JetTypeMapper {
if (jetType.equals(JetStandardClasses.getUnitType()) || jetType.equals(JetStandardClasses.getNothingType())) {
return Type.VOID_TYPE;
}
if (jetType.equals(JetStandardClasses.getNullableNothingType())) {
return TYPE_OBJECT;
}
return mapType(jetType, kind);
}
@@ -178,4 +178,11 @@ public class ClassGenTest extends CodegenTestCase {
blackBoxFile("regressions/kt48.jet");
System.out.println(generateToText());
}
public void testKt309 () throws Exception {
loadText("fun box() = null");
final Method method = generateFunction("box");
assertEquals(method.getReturnType().getName(), "java.lang.Object");
System.out.println(generateToText());
}
}