From 1cd650621f2d1c16c1a3026df5e588ae6e6d3e4d Mon Sep 17 00:00:00 2001 From: Som Snytt Date: Thu, 9 Jun 2022 11:35:53 -0700 Subject: [PATCH] Partest uses -release 8 --- src/partest/scala/tools/partest/nest/Runner.scala | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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