KT-309
This commit is contained in:
@@ -317,6 +317,9 @@ public class JetTypeMapper {
|
|||||||
if (jetType.equals(JetStandardClasses.getUnitType()) || jetType.equals(JetStandardClasses.getNothingType())) {
|
if (jetType.equals(JetStandardClasses.getUnitType()) || jetType.equals(JetStandardClasses.getNothingType())) {
|
||||||
return Type.VOID_TYPE;
|
return Type.VOID_TYPE;
|
||||||
}
|
}
|
||||||
|
if (jetType.equals(JetStandardClasses.getNullableNothingType())) {
|
||||||
|
return TYPE_OBJECT;
|
||||||
|
}
|
||||||
return mapType(jetType, kind);
|
return mapType(jetType, kind);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -178,4 +178,11 @@ public class ClassGenTest extends CodegenTestCase {
|
|||||||
blackBoxFile("regressions/kt48.jet");
|
blackBoxFile("regressions/kt48.jet");
|
||||||
System.out.println(generateToText());
|
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());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user