There is a compilation error (only in the REPL) in the following example, where none should be:
scala> val f: (Int*) => Int = _.size
<console>:5: error: type mismatch;
found : Int* => Int
required: Seq[Int] => Int
lazy val $result = f
According to the spec,`*` is only allowed on method parameters. The compiler also allows them in function types, but the behaviour is unspecified. Personally, I'd like to disallow this.
This is fixed in the Ammonite REPL
@ val f: (Int*) => Int = _.size
f: Seq[Int] => Int = <function1>
res2: Int = 1
@ f(1, 3, 4)
res3: Int = 3
Welcome to Scala 2.12.1 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_111).
Type in expressions for evaluation. Or try :help.
f: Int* => Int = $$Lambda$1042/1092382020@1687eb01
res0: Int = 3
// the relevant definitions:
// <stable> <accessor> def f: Int* => Int = $iw.this.f
// <stable> <accessor> lazy val $result: Seq[Int] => Int = $line1.$read.$iw.$iw.f;