I had a similar problem. Found example 8.1 in a book that looked like this:
object LongLines { def processFile(filename: String, width: Int) **{** val source = Source.fromFile(filename) for (line <- source.getLines) processLine(filename, width, line) **}**
Note: "def processFile (file name: String, width: Int) {" and end "}"
I surrounded the body of 'method' {} and scala compiled it without error messages.
source share