Skip to content

support JEP 476: Module Import Declarations #20530

Open
@xuwei-k

Description

@xuwei-k

Compiler version

  • 3.3.3
  • 3.4.2
  • 3.5.0-RC1
  • 3.5.1-RC1-bin-20240606-27a3f80-NIGHTLY

Minimized code

$ java --version
openjdk 23-ea 2024-09-17
OpenJDK Runtime Environment (build 23-ea+25-2094)
OpenJDK 64-Bit Server VM (build 23-ea+25-2094, mixed mode, sharing)

B.scala

class B

A.java

import module java.base;

public class A {
}

build.sbt

javacOptions ++= Seq("--enable-preview", "--release", scala.util.Properties.javaSpecVersion)

scalaVersion := "3.5.0-RC1"

project/build.properties

sbt.version=1.10.0

Output

[error] -- Error: /my-example-project/A.java:1:14 ------------------
[error] 1 |import module java.base;
[error]   |              ^^^^
[error]   |              ';' expected but identifier found.
[error] one error found
[error] (Compile / compileIncremental) Compilation failed

Expectation

don't report error

note

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:jdkIssues tied to artifacts published under a particular jdkcompat:javacompat:java:jepIssues corresponding to a JEP (JDK Enhancement Proposal)compat:java:jep:unstableIssues corresponding to a JEP (JDK Enhancement Proposal) which is not stable yet.itype:bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions