boxing for constants

This commit is contained in:
Dmitry Jemerov
2011-04-07 15:56:20 +02:00
parent 16d475249f
commit a053bda91b
4 changed files with 36 additions and 30 deletions
@@ -221,12 +221,18 @@ public class NamespaceGenTest extends LightCodeInsightFixtureTestCase {
assertEquals(239, main.invoke(null, new Object[]{null}));
}
public void testBoxingInCall() throws Exception {
public void testIntBoxed() throws Exception {
loadText("fun foo(s: String): Int? = Integer.getInteger(s, 239)");
final Method main = generateFunction();
assertEquals(239, main.invoke(null, "no.such.system.property"));
}
public void testBoxConstant() throws Exception {
loadText("fun foo(): Int? = 239");
final Method main = generateFunction();
assertEquals(239, main.invoke(null));
}
public void testLong() throws Exception {
loadText("fun foo(a: Long, b: Long): Long = a + b");
System.out.println(generateToText());