Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider minTargetVersion as always supported #13811

Merged
merged 1 commit into from
Nov 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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())
}