查看 Int 伴随对象中的最后一行。我认为这与视图的概念有关:
object Int extends AnyValCompanion {
/** The smallest value representable as a Int.
*/
final val MinValue = java.lang.Integer.MIN_VALUE
/** The largest value representable as a Int.
*/
final val MaxValue = java.lang.Integer.MAX_VALUE
/** Transform a value type into a boxed reference type.
*
* @param x the Int to be boxed
* @return a java.lang.Integer offering `x` as its underlying value.
*/
def box(x: Int): java.lang.Integer = java.lang.Integer.valueOf(x)
/** Transform a boxed type into a value type. Note that this
* method is not typesafe: it accepts any Object, but will throw
* an exception if the argument is not a java.lang.Integer.
*
* @param x the java.lang.Integer to be unboxed.
* @throws ClassCastException if the argument is not a java.lang.Integer
* @return the Int resulting from calling intValue() on `x`
*/
def unbox(x: java.lang.Object): Int = x.asInstanceOf[java.lang.Integer].intValue()
/** The String representation of the scala.Int companion object.
*/
override def toString = "object scala.Int"
/** Language mandated coercions from Int to "wider" types.
*/
implicit def int2long(x: Int): Long = x.toLong
implicit def int2float(x: Int): Float = x.toFloat
implicit def int2double(x: Int): Double = x.toDouble
}

另请参阅:Scala 在哪里寻找隐式?
编辑
根据@som-snytt 的评论:
scala -Ywarn-numeric-widen
Welcome to Scala 2.11.8 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_91).
Type in expressions for evaluation. Or try :help.
scala> object Test {
| implicit def i2d(x: Int): Double = {
| println("foo")
| x.toDouble
| }
|
| implicit def d2i(x: Double): Int = {
| x.toInt
| }
|
| val x: Int = 10
| val y: Double = x
| val z: Int = 3.5
| }
<console>:22: warning: implicit numeric widening
val y: Double = x
^
另外,添加到@Alec关于扩大的答案: http ://www.scala-lang.org/files/archive/spec/2.11/06-expressions.html#value-conversions
来自:http ://www.scala-lang.org/files/archive/spec/2.11/03-types.html#weak-conformance
弱一致性 在某些情况下,Scala 使用更一般的一致性关系。类型 >SS 弱符合类型 TT,写为 S<:wTS<:wT,如果 S<:TS<:T 或 >SS 和 TT 都是原始数字类型,并且 SS 在以下 >排序中位于 TT 之前。
字节 <:w<:w 短
短 <:w<:w 整数
字符 <:w<:w 整数
整数 <:w<:w 长
长 <:w<:w 浮点数
浮点 <:w<:w 双精度
弱最小上界是关于弱一致性的最小上界。