summaryrefslogtreecommitdiff
path: root/src/library/scala/Short.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-04-14 11:40:00 +0100
committerPaul Phillips <paulp@improving.org>2012-04-14 11:48:30 +0100
commit0b3b12fb29b8a4a624c4a0bb4520114f10599036 (patch)
treec0176b6e048369cd8f1297b2d39ec66216e8768a /src/library/scala/Short.scala
parent3a2901da406f2478b5634b0636e56de9c4cd676d (diff)
downloadscala-0b3b12fb29b8a4a624c4a0bb4520114f10599036.tar.gz
scala-0b3b12fb29b8a4a624c4a0bb4520114f10599036.tar.bz2
scala-0b3b12fb29b8a4a624c4a0bb4520114f10599036.zip
Move primitive widening implicits to companions.
Take a 15-implicit load off Predef and put it where it belongs: on those brave souls who like their longs to get floaty by way of T.
Diffstat (limited to 'src/library/scala/Short.scala')
-rw-r--r--src/library/scala/Short.scala4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/library/scala/Short.scala b/src/library/scala/Short.scala
index 5664c3b44c..707f9bc4eb 100644
--- a/src/library/scala/Short.scala
+++ b/src/library/scala/Short.scala
@@ -622,5 +622,9 @@ object Short extends AnyValCompanion {
/** The String representation of the scala.Short companion object.
*/
override def toString = "object scala.Short"
+ implicit def short2int(x: Short): Int = x.toInt
+ implicit def short2long(x: Short): Long = x.toLong
+ implicit def short2float(x: Short): Float = x.toFloat
+ implicit def short2double(x: Short): Double = x.toDouble
}