scala/scala — pull request #2593 by paulp (2013-05-24 13:57:11+00:00)
Title: Make all numeric coercions explicit.

Optimistically, this is preparation for a day when we don't let numeric types
drift with the winds. Even without the optimism it's a good idea. I found a
couple bugs in the process - how many people would see this one coming without
compiler help. One of these methods has an inappropriately wide return type.

def signum(x: Int): Int = java.lang.Integer.signum(x)
def signum(x: Long): Long = java.lang.Long.signum(x)
def signum(x: Float): Float = java.lang.Math.signum(x)
def signum(x: Double): Double = java.lang.Math.signum(x)

Managing type coercions manually is a bit tedious, no doubt, but it's not
tedious enough to warrant abandoning type safety just because java did it.