Scala 为什么eta扩展没有';不能使用隐式添加的成员

Scala 为什么eta扩展没有';不能使用隐式添加的成员,scala,functional-programming,typeclass,Scala,Functional Programming,Typeclass,这不起作用: "%-10s %-50s %s".format _ <console>:13: error: missing arguments for method format in trait StringLike; follow this method with `_' if you want to treat it as a partially applied function "%-10s %-50s %s".format _ “%-10s%-50s

这不起作用:

"%-10s %-50s %s".format _
<console>:13: error: missing arguments for method format in trait StringLike;
 follow this method with `_' if you want to treat it as a partially applied function
          "%-10s %-50s %s".format _
“%-10s%-50s%s”。格式_
:13:错误:trait StringLike中缺少方法格式的参数;
如果要将其视为部分应用的函数,请使用“\u1”遵循此方法
“%-10s%-50s%s”。格式_
但这是可行的:

import scala.collection.immutable._

scala> ("%-10s %-50s %s": StringLike[_]).format _
res91: Seq[Any] => String = <function1>
导入scala.collection.immutable_
scala>(“%-10s%-50s%s”:StringLike[)]格式_
res91:Seq[Any]=>String=
那么,为什么我必须显式指定类型类呢?

这就是为什么:

这不完全是为什么

不确定这是否需要说明,但:

scala> val f: Seq[Any] => String = "%-10s %-50s %s".format
f: Seq[Any] => String = <function1>
scala>val f:Seq[Any]=>String=“%-10s%-50s%s”。格式
f:Seq[Any]=>字符串=

“%-10s%-50s%s”。格式(551;)也有效。格式(551;)不一样-格式(551;)将从一个参数为您提供函数,即使它实际上是551;*。反过来,
format
不受参数计数的约束。最好发布完整的代码,我指的是与“隐式添加的成员”相关的部分。完整的代码在scala库中:)。字符串隐式转换为StringLike。格式是StringLike的一部分。当我问这样的问题时,我通常感觉答案是某种SI-XXXX:)