scala - 函数定义杀死了 Scala 编译器

标签 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.

最佳答案

这是2.11.5的bug,SI-9089已在2.11.6修复。 https://issues.scala-lang.org/browse/SI-9089

关于scala - 函数定义杀死了 Scala 编译器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35215163/

相关文章:

scala - Intellij IDEA : Why build. sbt 以红色突出显示?

scala - 如何使用 sbt 汇编?

scala - 在 Scala 中修改大文件

scala - 将 DataFrame 写入 Parquet 或 Delta 似乎没有被并行化 - 耗时太长

java - 渲染 Play Framework 2 View

scala - 更新不可变对象(immutable对象)

scala - Unit.type 和 Unit 之间有什么区别

scala - 是什么使变量可见(intellij 想法)

performance - 为什么 Scala 标准库中 @specialized 的东西这么少?

java - Java 和 Scala 类加载的区别