Skip to content

Commit aae6dde

Browse files
committed
Tests for -release:8 consistency between host JDKs
1 parent 047e5f0 commit aae6dde

File tree

4 files changed

+18
-0
lines changed

4 files changed

+18
-0
lines changed

compiler/test/dotty/tools/dotc/CompilationTests.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ class CompilationTests {
6464
compileFile("tests/pos-custom-args/help.scala", defaultOptions.and("-help", "-V", "-W", "-X", "-Y")),
6565
compileFile("tests/pos-custom-args/i10383.scala", defaultOptions.and("-source", "future", "-deprecation", "-Xfatal-warnings")),
6666
compileFile("tests/pos-custom-args/i13044.scala", defaultOptions.and("-Xmax-inlines:33")),
67+
compileFile("tests/pos-custom-args/jdk-8-app.scala", defaultOptions.and("-release:8")),
6768
).checkCompile()
6869
}
6970

@@ -182,6 +183,7 @@ class CompilationTests {
182183
compileFile("tests/neg-custom-args/i7314.scala", defaultOptions.and("-Xfatal-warnings", "-source", "future")),
183184
compileFile("tests/neg-custom-args/feature-shadowing.scala", defaultOptions.and("-Xfatal-warnings", "-feature")),
184185
compileDir("tests/neg-custom-args/hidden-type-errors", defaultOptions.and("-explain")),
186+
compileFile("tests/neg-custom-args/jdk-9-app.scala", defaultOptions.and("-release:8")),
185187
).checkExpectedErrors()
186188
}
187189

tests/neg-custom-args/jdk-9-app.check

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
-- [E006] Not Found Error: tests/neg-custom-args/jdk-9-app.scala:4:10 --------------------------------------------------
2+
4 | println(ProcessHandle.current().pid()) // error: not found
3+
| ^^^^^^^^^^^^^
4+
| Not found: ProcessHandle
5+
6+
longer explanation available when compiling with `-explain`

tests/neg-custom-args/jdk-9-app.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import java.lang.ProcessHandle
2+
3+
object Jdk9App extends App {
4+
println(ProcessHandle.current().pid()) // error: not found
5+
}

tests/pos-custom-args/jdk-8-app.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import java.time.LocalDate
2+
3+
object Jdk8App extends App {
4+
println(LocalDate.now())
5+
}

0 commit comments

Comments
 (0)