0

此代码使用"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

编译失败并出现错误:

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

任何想法?

4

0 回答 0