-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
area:jdkIssues tied to artifacts published under a particular jdkIssues tied to artifacts published under a particular jdkcompat:javacompat:java:jepIssues corresponding to a JEP (JDK Enhancement Proposal)Issues corresponding to a JEP (JDK Enhancement Proposal)compat:java:jep:unstableIssues corresponding to a JEP (JDK Enhancement Proposal) which is not stable yet.Issues corresponding to a JEP (JDK Enhancement Proposal) which is not stable yet.itype:enhancement
Description
Compiler version
- 3.3.1
- 3.4.0-RC1-bin-20230921-3d539e6-NIGHTLY
Minimized code
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
Output
[error] 1 |void main() {
[error] | ^^^^
[error] | illegal start of type declaration
[error] one error found
[error] (Compile / compileIncremental) Compilation failed
Expectation
success compile
Note
unkarjedy
Metadata
Metadata
Assignees
Labels
area:jdkIssues tied to artifacts published under a particular jdkIssues tied to artifacts published under a particular jdkcompat:javacompat:java:jepIssues corresponding to a JEP (JDK Enhancement Proposal)Issues corresponding to a JEP (JDK Enhancement Proposal)compat:java:jep:unstableIssues corresponding to a JEP (JDK Enhancement Proposal) which is not stable yet.Issues corresponding to a JEP (JDK Enhancement Proposal) which is not stable yet.itype:enhancement
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
Kordyjan commentedon Sep 22, 2023
3.3.2 will add support to JDK 21.
We will probably need to take care of handling the new main methods.
Java parser: add support for unnamed classes (JEP-445)
Java parser: add support for unnamed classes (JEP-445)
Java parser: add support for unnamed classes (JEP-445)
xuwei-k commentedon May 16, 2025
https://openjdk.org/jeps/512 finalize in JDK 25