Error with default argument in Source.getLines (Scala 2.8.0 RC1)

Posted by Derek on Stack Overflow See other posts from Stack Overflow or by Derek
Published on 2010-04-28T19:20:22Z Indexed on 2010/04/28 19:57 UTC
Read the original article Hit count: 271

Filed under:
|

assuming I running Scala 2.8.0 RC1, the following scala code should print out the content of the file "c:/hello.txt"

for ( line<-Source.fromPath( "c:/hello.txt" ).getLines )    
        println( line )

However, when I run it, I get the following error

<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

From what I understand, Scala should use the default argument "compat.Platform.EOL" for "getLines". I am wondering if I did wrong or is it a bug in scala 2.8

Thanks

© Stack Overflow or respective owner

Related posts about scala-2.8

Related posts about scala