假设我运行 Scala 2.8.0 RC1,下面的 scala 代码应该打印出文件“c:/hello.txt”的内容
for ( line<-Source.fromPath( "c:/hello.txt" ).getLines )
println( line )
但是,当我运行它时,出现以下错误
<console>:10: error: missing arguments for method getLines in class Source;
follow this method with `_' if you want to treat it as a partially applied function
Error occured in an application involving default arguments.
val it = Source.fromPath("c:/hello.scala").getLines
据我了解,Scala 应该为“getLines”使用默认参数“compat.Platform.EOL”。我想知道我做错了还是 scala 2.8 中的错误
谢谢