Open xuwei-k opened 9 months ago
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
sbt -J--enable-preview compile
https://github.com/scala/scala/blob/e67d287447c09720468f8bebcb0302bd92d75f43/src/compiler/scala/tools/nsc/javac/JavaParsers.scala#L1074
[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
Reproduction steps
A.java
B.scala
build.sbt
project/build.properties
Problem
sbt -J--enable-preview compile
https://github.com/scala/scala/blob/e67d287447c09720468f8bebcb0302bd92d75f43/src/compiler/scala/tools/nsc/javac/JavaParsers.scala#L1074