Mercurial > hg > graal-jvmci-8
diff graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/SLTypes.java @ 12396:3faec5ab0696
SL: updated simple lanugage type system to use an implicit cast.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Fri, 11 Oct 2013 20:06:33 +0200 |
parents | f1c3f50ac36e |
children | 71991b7a0f14 |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/SLTypes.java Fri Oct 11 20:05:55 2013 +0200 +++ b/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/SLTypes.java Fri Oct 11 20:06:33 2013 +0200 @@ -46,32 +46,9 @@ } } - @TypeCheck - public boolean isBigInteger(Object value) { - return value instanceof Integer || value instanceof BigInteger; - } - - @TypeCast - public BigInteger asBigInteger(Object value) { - if (value instanceof Integer) { - return BigInteger.valueOf((int) value); - } else { - return (BigInteger) value; - } + @ImplicitCast + public BigInteger castBigInteger(int integer) { + return BigInteger.valueOf(integer); } - @TypeCast - public BigInteger asBigInteger(int value) { - return BigInteger.valueOf(value); - } - - @TypeCheck - public boolean isBigInteger(@SuppressWarnings("unused") int value) { - return true; - } - - @ImplicitCast - public BigInteger castBigInteger(int value) { - return BigInteger.valueOf(value); - } }