Skip to content

Commit

Permalink
Merge pull request #13811 from arixmkii/minTarget
Browse files Browse the repository at this point in the history
Consider minTargetVersion as always supported
  • Loading branch information
prolativ committed Nov 15, 2021
2 parents 16f9b22 + 987d986 commit 4d81752
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/config/ScalaSettings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ object ScalaSettings:
val jdkVersion = JDK9Reflectors.runtimeVersionMajor(JDK9Reflectors.runtimeVersion()).intValue()
val maxVersion = Math.min(jdkVersion, maxTargetVersion)
(minTargetVersion to maxVersion).toList.map(_.toString)
else List()
else List(minTargetVersion).map(_.toString)

def defaultClasspath: String = sys.env.getOrElse("CLASSPATH", ".")

Expand Down
2 changes: 2 additions & 0 deletions compiler/test/dotty/tools/dotc/CompilationTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ class CompilationTests {
compileFile("tests/pos-custom-args/help.scala", defaultOptions.and("-help", "-V", "-W", "-X", "-Y")),
compileFile("tests/pos-custom-args/i10383.scala", defaultOptions.and("-source", "future", "-deprecation", "-Xfatal-warnings")),
compileFile("tests/pos-custom-args/i13044.scala", defaultOptions.and("-Xmax-inlines:33")),
compileFile("tests/pos-custom-args/jdk-8-app.scala", defaultOptions.and("-release:8")),
).checkCompile()
}

Expand Down Expand Up @@ -184,6 +185,7 @@ class CompilationTests {
compileDir("tests/neg-custom-args/hidden-type-errors", defaultOptions.and("-explain")),
compileFile("tests/neg-custom-args/i13026.scala", defaultOptions.and("-print-lines")),
compileFile("tests/neg-custom-args/i13838.scala", defaultOptions.and("-Ximplicit-search-limit", "1000")),
compileFile("tests/neg-custom-args/jdk-9-app.scala", defaultOptions.and("-release:8")),
).checkExpectedErrors()
}

Expand Down
6 changes: 6 additions & 0 deletions tests/neg-custom-args/jdk-9-app.check
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
-- [E006] Not Found Error: tests/neg-custom-args/jdk-9-app.scala:4:10 --------------------------------------------------
4 | println(ProcessHandle.current().pid()) // error: not found
| ^^^^^^^^^^^^^
| Not found: ProcessHandle

longer explanation available when compiling with `-explain`
5 changes: 5 additions & 0 deletions tests/neg-custom-args/jdk-9-app.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import java.lang.ProcessHandle

object Jdk9App extends App {
println(ProcessHandle.current().pid()) // error: not found
}
5 changes: 5 additions & 0 deletions tests/pos-custom-args/jdk-8-app.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import java.time.LocalDate

object Jdk8App extends App {
println(LocalDate.now())
}

0 comments on commit 4d81752

Please sign in to comment.