Skip to content

Commit 1a2d9db

Browse files
committed
Test for -release:8 consistency between host JDK
1 parent 047e5f0 commit 1a2d9db

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ class CompilationTests {
182182
compileFile("tests/neg-custom-args/i7314.scala", defaultOptions.and("-Xfatal-warnings", "-source", "future")),
183183
compileFile("tests/neg-custom-args/feature-shadowing.scala", defaultOptions.and("-Xfatal-warnings", "-feature")),
184184
compileDir("tests/neg-custom-args/hidden-type-errors", defaultOptions.and("-explain")),
185+
compileFile("tests/neg-custom-args/jdk-9-app.scala", defaultOptions.and("-release:8")),
185186
).checkExpectedErrors()
186187
}
187188

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+
}

0 commit comments

Comments
 (0)