Robert
05/18/2019, 7:13 PMvar myInt : Int = ^1L // implicit call toInt() on this Long
or whatever symbol or syntax. Much better than using all sorts of toLong, toInt, toString, toByte etc explicit in code. Losing a lot of the benefits of type inference (if that's the right name)Robert
05/19/2019, 6:10 AMtseisel
05/19/2019, 8:56 AMLong
to a Int
is potentially dangerous (as it could lead to a completely different result).
I admit that this is security over comfort, as toInt()
and toDouble()
calls harm readability.tseisel
05/19/2019, 8:59 AMInteger
is null
, implicitly unboxing it would cause a very hard to find NullPointerException
.Robert
05/21/2019, 7:00 PM