Skip to content

Commit

Permalink
Partest uses -release 8
Browse files Browse the repository at this point in the history
  • Loading branch information
som-snytt committed Jun 9, 2022
1 parent f33a40e commit 2d26b75
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/partest/scala/tools/partest/nest/Runner.scala
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions test/files/neg/nonunit-statement.scala
Expand Up @@ -156,6 +156,7 @@ class J {
import java.util.Collections
def xs: java.util.List[Int] = ???
def f(): Int = {
java.util.List.of[Int]()
Collections.checkedList[Int](xs, classOf[Int])
42
}
Expand Down

0 comments on commit 2d26b75

Please sign in to comment.