2016-02-05 71 views
0

任何人都可以向我解釋爲什麼當我輸入到Scala REPL中時,該條目會影響編譯器嗎?函數定義slay Scala編譯器

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

它適用於我在我的斯卡拉2.11.7 –

回答