diff --git a/src/partest/scala/tools/partest/nest/Runner.scala b/src/partest/scala/tools/partest/nest/Runner.scala index 990ed6be347a..d5c63ed442ea 100644 --- a/src/partest/scala/tools/partest/nest/Runner.scala +++ b/src/partest/scala/tools/partest/nest/Runner.scala @@ -453,10 +453,12 @@ class Runner(val testInfo: TestInfo, val suiteRunner: AbstractRunner) { } // all sources in a round may contribute flags via // scalac: -flags + // if a javaVersion isn't specified, require the minimum viable using -release 8 to avoid gotcha in CI. def flagsForCompilation(sources: List[File]): List[String] = { - val perFile = toolArgsFor(sources)("scalac") - if (parentFile.getParentFile.getName == "macro-annot") "-Ymacro-annotations" :: perFile - else perFile + var perFile = toolArgsFor(sources)("scalac") + if (parentFile.getParentFile.getName == "macro-annot") perFile ::= "-Ymacro-annotations" + if (toolArgsFor(sources)("javaVersion", split = false).isEmpty) perFile :::= List("-release", "8") + perFile } // inspect sources for tool args