Skip to content

-Xsource:3.0 produces warning for a case class extending AnyVal #11889

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

Closed
thesamet opened this issue Feb 22, 2020 · 1 comment
Closed

-Xsource:3.0 produces warning for a case class extending AnyVal #11889

thesamet opened this issue Feb 22, 2020 · 1 comment

Comments

@thesamet
Copy link

Somewhat similarly to #11657 , the following code:

case class Foo(x: Int) extends AnyVal

produces:

Auto-application to `()` is deprecated. Supply the empty argument list `()` explicitly to invoke method hashCode,
[warn] or remove the empty argument list from its definition (Java-defined methods are exempt).
[warn] In Scala 3, an unapplied method like this will be eta-expanded into a function.

when compiling with -Xsource:3.0

@som-snytt
Copy link

Yes, this is warning about the same synthetic code as the other ticket:

override <synthetic> def hashCode(): Int = Foo.this.x.hashCode();

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

No branches or pull requests

2 participants