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

scalac cannot parse records that implement interfaces #12474

Closed
s5bug opened this issue Oct 17, 2021 · 2 comments
Closed

scalac cannot parse records that implement interfaces #12474

s5bug opened this issue Oct 17, 2021 · 2 comments

Comments

@s5bug
Copy link

s5bug commented Oct 17, 2021

reproduction steps

using Scala 2.13.6, Java 17

sealed and permits commented out due to #12159

public /* sealed */ interface Nat /* permits Nat.Zero, Nat.Succ */ {
    public static final record Zero() implements Nat {}
    public static final record Succ(Nat pred) implements Nat {}
}

problem

`;` expected but `implements` found.
    public static final record Zero() implements Nat {}

The error message is confusing as well, as

public static final record Zero();

does not work, but

public static final record Zero() {}

does.

@lrytz lrytz added this to the 2.13.7 milestone Oct 18, 2021
@SethTisue SethTisue modified the milestones: 2.13.7, 2.13.8 Oct 21, 2021
@dwijnand
Copy link
Member

@harpocrates fyi, if you feel like looking at this

@som-snytt
Copy link

I added a test, but this always worked. record support arrived in 2.13.7 which was merged that summer but released Nov 1, after this ticket.

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

No branches or pull requests

5 participants