Permalink
Browse files

"reinstate autobox int as Integer (note this change is for evaluation…

… only)""

This reverts commit abfa803.
  • Loading branch information...
1 parent dceb9d1 commit 798a98bc1b844b0fe08e9309886823cf7ca92604 @stuarthalloway stuarthalloway committed Oct 25, 2011
Showing with 13 additions and 8 deletions.
  1. +3 −2 src/jvm/clojure/lang/Compiler.java
  2. +10 −6 src/jvm/clojure/lang/Reflector.java
@@ -769,8 +769,9 @@ else if(returnType == char.class)
{
if(returnType == int.class)
{
- gen.visitInsn(I2L);
- gen.invokeStatic(NUMBERS_TYPE, Method.getMethod("Number num(long)"));
+ gen.invokeStatic(INTEGER_TYPE, intValueOfMethod);
+// gen.visitInsn(I2L);
+// gen.invokeStatic(NUMBERS_TYPE, Method.getMethod("Number num(long)"));
}
else if(returnType == float.class)
{
@@ -472,7 +472,9 @@ static public boolean paramArgTypeMatch(Class paramType, Class argType){
if(paramType == int.class)
return argType == Integer.class
|| argType == long.class
- || argType == Long.class;// || argType == FixNum.class;
+ || argType == Long.class
+ || argType == short.class
+ || argType == byte.class;// || argType == FixNum.class;
else if(paramType == float.class)
return argType == Float.class
|| argType == double.class;
@@ -481,7 +483,9 @@ else if(paramType == double.class)
|| argType == float.class;// || argType == DoubleNum.class;
else if(paramType == long.class)
return argType == Long.class
- || argType == int.class;// || argType == BigNum.class;
+ || argType == int.class
+ || argType == short.class
+ || argType == byte.class;// || argType == BigNum.class;
else if(paramType == char.class)
return argType == Character.class;
else if(paramType == short.class)
@@ -516,10 +520,10 @@ public static Object prepRet(Class c, Object x){
return x;
if(x instanceof Boolean)
return ((Boolean) x)?Boolean.TRUE:Boolean.FALSE;
- else if(x instanceof Integer)
- {
- return ((Integer)x).longValue();
- }
+// else if(x instanceof Integer)
+// {
+// return ((Integer)x).longValue();
+// }
// else if(x instanceof Float)
// return Double.valueOf(((Float) x).doubleValue());
return x;

0 comments on commit 798a98b

Please sign in to comment.