-
Notifications
You must be signed in to change notification settings - Fork 22
scala.tools.nsc.javac.JavaParsers can't parse JDK17 "Sealed Classes" #12159
Copy link
Copy link
Closed
Closed
Copy link
Description
reproduction steps
https://openjdk.java.net/jeps/360
https://github.com/scala/scala/blob/v2.13.3/src/compiler/scala/tools/nsc/javac/JavaParsers.scala#L1002
$ java --version
openjdk 15 2020-09-15
OpenJDK Runtime Environment (build 15+36-1562)
OpenJDK 64-Bit Server VM (build 15+36-1562, mixed mode, sharing)
build.sbt
javacOptions ++= Seq("--enable-preview", "--release", "15")
scalaVersion := "2.13.3"A.java
sealed class A{}
final class B extends A{}C.scala
class Csbt version: 1.3.13
problem
run sbt compile
A.java:1:8: illegal start of type declaration
[error] sealed class A{}
[error] ^
[error] one error found
[error] (Compile / compileIncremental) Compilation failed
[error] Total time: 0 s, completed 2020/09/22 10:18:53
workaround
// build.sbt
compileOrder := CompileOrder.JavaThenScalanote
similar issue #11908
Reactions are currently unavailable