scala-arm: Expression of type Iterator[Int] doesn't conform to expected type ManagedResource[B_]

48 Views Asked by At

This code using "com.jsuereth" %% "scala-arm" % "2.0":

import resource._
val lineLengths = for {
  source <- managed(scala.io.Source.fromFile("file.txt"))
  line <- source.getLines()
} yield line.length

Fails compiling with error:

Expression of type Iterator[Int] doesn't conform to expected type ManagedResource[B_]

Any idea?

0

There are 0 best solutions below