Skip to content

Support JEP 401: Value Objects in JavaParsers #13194

Description

@xuwei-k

Reproduction steps

$ java --version
openjdk 28-ea 2027-03-23
OpenJDK Runtime Environment (build 28-ea+16-1181)
OpenJDK 64-Bit Server VM (build 28-ea+16-1181, mixed mode, sharing)

A.java

package x1;

value record A(int n){}

B.scala

package x2;

class B

build.sbt

scalaVersion := "2.13.18"

javacOptions ++= Seq("--enable-preview", "--release", "28")

project/build.properties

sbt.version=1.13.0

Problem

sbt -J--enable-preview compile

A.java:3:14: `;` expected but identifier found.
[error] value record A(int n){}
[error]              ^
[error] one error found
[error] (Compile / compileIncremental) Compilation failed

Workaround in sbt

set

compileOrder := CompileOrder.JavaThenScala

or

compileOrder := CompileOrder.ScalaThenJava

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions