Reading lines from file in Scala

io, scala

Solution

There is no `fromPath` in `Source`, just a `fromFile`, which accepts a String path. Good luck on Coursera.

Problem

Again Scala basic operations are making my life painful :D. So I have to read lines from file...just a trivial I/O operation. In every example on internet they are doing: ``` import scala.io.Source for(line <- Source.fromPath("integerArray.txt").getLines()) println(line) ``` But my IntelliJ is throwing error : value fromPath is not a member of object scala.io.Source. Does anyone knows what is problem here? ... I have installed last version of Scala few months ago and IntelliJ Scala plugin is also up to date so I doubt this might be a reason...

Original source