为什么scala中不推荐使用.+()方法?

jcm*_*jcm 2 scala

只是想知道为什么我在REPL中看到以下内容:

scala> 5. +(9)警告:有1个弃用警告; 使用-deprecation重新运行以获取详细信息res18:Double = 14.0

Nat*_*tix 5

如果您按照说明操作并使用REPL运行scala -deprecation,您将看到弃用的原因:

scala> 1 + 1
res0: Int = 2

scala> 1.+(1)
<console>:1: warning: This lexical syntax is deprecated.  From scala 2.11,
a dot will only be considered part of a number if it is immediately followed
by a digit.
       1.+(1)
       ^
res1: Double = 2.0
Run Code Online (Sandbox Code Playgroud)

在Scala 2.10.1上测试