Skip to content
New issue

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

scala.tools.nsc.javac.JavaParsers can't parse JDK14 records #11908

Open
xuwei-k opened this issue Mar 16, 2020 · 2 comments
Open

scala.tools.nsc.javac.JavaParsers can't parse JDK14 records #11908

xuwei-k opened this issue Mar 16, 2020 · 2 comments
Assignees
Milestone

Comments

@xuwei-k
Copy link

@xuwei-k xuwei-k commented Mar 16, 2020

reproduction steps

https://openjdk.java.net/jeps/359

https://github.com/scala/scala/blob/a20345d2380dfc63ff0aa41d4ab97b538a9f74a7/src/compiler/scala/tools/nsc/javac/JavaParsers.scala#L874

$ java --version
openjdk 14 2020-03-17
OpenJDK Runtime Environment (build 14+36-1461)
OpenJDK 64-Bit Server VM (build 14+36-1461, mixed mode, sharing)

build.sbt

javacOptions ++= Seq("--enable-preview", "--release", "14")
scalaVersion := "2.13.1"

A.java

package aaa;

public record A(int x, int y) { }

B.scala

package bbb

class B {
  def x = new aaa.A(3, 4)
}

sbt version 1.3.8

problem

A.java:3:15: illegal start of type declaration
[error] public record A(int x, int y) { }
[error]               ^
[error] one error found
[error] (Compile / compileIncremental) Compilation failed

expectation

no error.

workaround

// build.sbt
compileOrder := CompileOrder.JavaThenScala
@xuwei-k xuwei-k added the jdk14 label Mar 16, 2020
@dwijnand dwijnand added the parser label Mar 16, 2020
@SethTisue SethTisue added this to the Backlog milestone Mar 16, 2020
@mghildiy

This comment has been minimized.

Copy link

@mghildiy mghildiy commented Mar 20, 2020

Is this taken up?

@SethTisue

This comment has been minimized.

Copy link
Member

@SethTisue SethTisue commented Mar 26, 2020

@mghildiy nearly certain nobody is working on this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.