16 May 2007 10:32
Re: Decimal package
Lex Spoon <lex <at> lexspoon.org>
2007-05-16 08:32:40 GMT
2007-05-16 08:32:40 GMT
Gilles Dubochet <gilles.dubochet <at> epfl.ch> writes:
> However, in the soon-to-be-released Scala 2.5.0, boxing of native
> values will be changed to use the standard Java mechanism
> (java.lang.Number, etc. or the MSIL correspondent). This means that
> runtime.BoxedWhatever classes will be removed. I believe your code
> depends on the boxing being done that way.
In fact, in Scala code, you should be able to use just "Int" and
"Long", etc. The compiler will arrange that the numbers get unboxed
as needed.
So instead of:
case that: runtime.BoxedInt => equals(context(that.intValue))
case that: runtime.BoxedLong => equals(context(that.longValue))
You can do:
case that: Int => equals(context(that))
case that: Long => equals(context(that))
(Or if you can't, it looks like a bug to me.)
Lex
RSS Feed