函数定义杀死了Scala编译器

时间:2016-02-05 02:08:26

标签: scala

有人可以向我解释为什么当我输入Scala REPL时这个条目会杀死编译器吗?

def combination(x: Int, y: Int, f: (Int,Int) => Int) = f(x,y)

我正在使用Scala 2.11.5

    at scala.tools.nsc.interpreter.ILoop$$anonfun$process$1.apply(ILoop.scala:904)
    at scala.reflect.internal.util.ScalaClassLoader$.savingContextLoader(ScalaClassLoader.scala:97)
    at scala.tools.nsc.interpreter.ILoop.process(ILoop.scala:904)
    at scala.tools.nsc.MainGenericRunner.runTarget$1(MainGenericRunner.scala:74)
    at scala.tools.nsc.MainGenericRunner.run$1(MainGenericRunner.scala:87)
    at scala.tools.nsc.MainGenericRunner.process(MainGenericRunner.scala:98)
    at scala.tools.nsc.MainGenericRunner$.main(MainGenericRunner.scala:103)
    at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)

That entry seems to have slain the compiler.  
Shall I replay your session? I can re-run each line except the last one.

1 个答案:

答案 0 :(得分:5)

它是2.11.5错误,SI-9089固定在2.11.6。 https://issues.scala-lang.org/browse/SI-9089