diff --git a/idea/src/org/jetbrains/jet/codegen/StackValue.java b/idea/src/org/jetbrains/jet/codegen/StackValue.java index 8dd0eafb09e..85edf04591e 100644 --- a/idea/src/org/jetbrains/jet/codegen/StackValue.java +++ b/idea/src/org/jetbrains/jet/codegen/StackValue.java @@ -96,18 +96,7 @@ public abstract class StackValue { @Override public void put(Type type, InstructionAdapter v) { - if (type == Type.INT_TYPE) { - if (value instanceof Number) { - v.iconst(((Number) value).intValue()); - } - else { - throw new UnsupportedOperationException("don't know how to put this value"); - } - } - // TODO other primitive types - else { - v.aconst(value); - } + v.aconst(value); } @Override diff --git a/idea/tests/org/jetbrains/jet/codegen/NamespaceGenTest.java b/idea/tests/org/jetbrains/jet/codegen/NamespaceGenTest.java index 197f12c4ec5..e1ca7e1ccfd 100644 --- a/idea/tests/org/jetbrains/jet/codegen/NamespaceGenTest.java +++ b/idea/tests/org/jetbrains/jet/codegen/NamespaceGenTest.java @@ -269,6 +269,12 @@ public class NamespaceGenTest extends LightCodeInsightFixtureTestCase { Byte.valueOf((byte) 126), Byte.valueOf((byte) 127), 1); } + public void testBooleanConstant() throws Exception { + loadText("fun foo(): Boolean = true"); + final Method main = generateFunction(); + assertEquals(true, main.invoke(null)); + } + private void binOpTest(final String text, final Object arg1, final Object arg2, final Object expected) throws Exception { loadText(text); System.out.println(generateToText());