We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JEP 445: Unnamed Classes and Instance Main Methods
Install JDK 21
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 := "3.3.1"
project/build.properties
sbt.version=1.9.6
sbt -J--enable-preview compile
[error] 1 |void main() { [error] | ^^^^ [error] | illegal start of type declaration [error] one error found [error] (Compile / compileIncremental) Compilation failed
success compile
The text was updated successfully, but these errors were encountered:
3.3.2 will add support to JDK 21. We will probably need to take care of handling the new main methods.
Sorry, something went wrong.
Java parser: add support for unnamed classes (JEP-445)
e9b364a
Fixes scala#18584
a55e5bc
01540b0
No branches or pull requests
Compiler version
Minimized code
Install JDK 21
A.java
B.scala
build.sbt
project/build.properties
sbt.version=1.9.6
sbt -J--enable-preview compile
Output
Expectation
success compile
Note
JEP 445: Unnamed Classes and Instance Main Methods
bug#12878The text was updated successfully, but these errors were encountered: