diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/JetTypeMapper.java b/compiler/backend/src/org/jetbrains/jet/codegen/JetTypeMapper.java index 61a1584b381..2b6513a7a0f 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/JetTypeMapper.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/JetTypeMapper.java @@ -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); } diff --git a/idea/tests/org/jetbrains/jet/codegen/ClassGenTest.java b/idea/tests/org/jetbrains/jet/codegen/ClassGenTest.java index 4e6f7802f56..17e5d4f9252 100644 --- a/idea/tests/org/jetbrains/jet/codegen/ClassGenTest.java +++ b/idea/tests/org/jetbrains/jet/codegen/ClassGenTest.java @@ -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()); + } }