Map Nothing to java.lang.Void

This commit is contained in:
Andrey Breslav
2013-10-25 15:13:23 +04:00
parent 1ff0ffbac6
commit ed95463d1e
11 changed files with 55 additions and 34 deletions
@@ -127,7 +127,7 @@ public class ClassGenTest extends CodegenTestCase {
public void testKt309() {
loadText("fun box() = null");
Method method = generateFunction("box");
assertEquals(method.getReturnType().getName(), "java.lang.Object");
assertEquals(method.getReturnType().getName(), "java.lang.Void");
}
/*
@@ -4352,6 +4352,16 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
doTest("compiler/testData/codegen/box/typeMapping/hashable.kt");
}
@TestMetadata("nothing.kt")
public void testNothing() throws Exception {
doTest("compiler/testData/codegen/box/typeMapping/nothing.kt");
}
@TestMetadata("nullableNothing.kt")
public void testNullableNothing() throws Exception {
doTest("compiler/testData/codegen/box/typeMapping/nullableNothing.kt");
}
}
@TestMetadata("compiler/testData/codegen/box/unit")
@@ -31,7 +31,7 @@ import org.jetbrains.jet.jvm.compiler.AbstractWriteSignatureTest;
/** This class is generated by {@link org.jetbrains.jet.generators.tests.GenerateTests}. DO NOT MODIFY MANUALLY */
@SuppressWarnings("all")
@TestMetadata("compiler/testData/writeSignature")
@InnerTestClasses({WriteSignatureTestGenerated.Constructor.class, WriteSignatureTestGenerated.DeclarationSiteVariance.class})
@InnerTestClasses({WriteSignatureTestGenerated.Constructor.class, WriteSignatureTestGenerated.DeclarationSiteVariance.class, WriteSignatureTestGenerated.Nothing.class})
public class WriteSignatureTestGenerated extends AbstractWriteSignatureTest {
public void testAllFilesPresentInWriteSignature() throws Exception {
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/writeSignature"), Pattern.compile("^(.+)\\.kt$"), true);
@@ -97,16 +97,6 @@ public class WriteSignatureTestGenerated extends AbstractWriteSignatureTest {
doTest("compiler/testData/writeSignature/NonGeneric.kt");
}
@TestMetadata("Nothing.kt")
public void testNothing() throws Exception {
doTest("compiler/testData/writeSignature/Nothing.kt");
}
@TestMetadata("NothingQ.kt")
public void testNothingQ() throws Exception {
doTest("compiler/testData/writeSignature/NothingQ.kt");
}
@TestMetadata("VarargCharSequence.kt")
public void testVarargCharSequence() throws Exception {
doTest("compiler/testData/writeSignature/VarargCharSequence.kt");
@@ -263,11 +253,30 @@ public class WriteSignatureTestGenerated extends AbstractWriteSignatureTest {
}
@TestMetadata("compiler/testData/writeSignature/nothing")
public static class Nothing extends AbstractWriteSignatureTest {
public void testAllFilesPresentInNothing() throws Exception {
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/writeSignature/nothing"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("nothing.kt")
public void testNothing() throws Exception {
doTest("compiler/testData/writeSignature/nothing/nothing.kt");
}
@TestMetadata("nullableNothing.kt")
public void testNullableNothing() throws Exception {
doTest("compiler/testData/writeSignature/nothing/nullableNothing.kt");
}
}
public static Test suite() {
TestSuite suite = new TestSuite("WriteSignatureTestGenerated");
suite.addTestSuite(WriteSignatureTestGenerated.class);
suite.addTestSuite(Constructor.class);
suite.addTestSuite(DeclarationSiteVariance.class);
suite.addTestSuite(Nothing.class);
return suite;
}
}