diff --git a/compiler/test/dotty/tools/utils.scala b/compiler/test/dotty/tools/utils.scala index c70dbf3456cb..388715f45cc2 100644 --- a/compiler/test/dotty/tools/utils.scala +++ b/compiler/test/dotty/tools/utils.scala @@ -47,7 +47,7 @@ def assertThrows[T <: Throwable: ClassTag](p: T => Boolean)(body: => Any): Unit end assertThrows def toolArgsFor(files: List[JPath], charset: Charset = UTF_8): List[String] = - files.flatMap(path => toolArgsParse(Files.lines(path, charset).limit(10).toScala(List))) + files.flatMap(path => toolArgsParse(resource(Files.lines(path, charset))(_.limit(10).toScala(List)))) // Inspect the first 10 of the given lines for compiler options of the form // `// scalac: args`, `/* scalac: args`, ` * scalac: args`.