Description
Reproduction steps
- Scala 2.13.12
- JDK 21
- https://openjdk.org/jeps/445
- xuwei-k/Scala-JEP-445@c96fe40
- https://github.com/xuwei-k/Scala-JEP-445/actions/runs/6268842307/job/17024415920
A.java
void main() {
System.out.println("hello");
}
B.scala
class B
build.sbt
javacOptions ++= Seq(
"-Xlint:preview",
"--enable-preview",
"--release",
scala.util.Properties.javaSpecVersion
)
scalaVersion := "2.13.12"
project/build.properties
sbt.version=1.9.6
Problem
sbt -J--enable-preview compile
[error] /home/runner/work/Scala-JEP-445/Scala-JEP-445/A.java:1:6: illegal start of type declaration
[error] void main() {
[error] ^
[error] one error found
[error] (Compile / compileIncremental) Compilation failed