Skip to content

-Xsource:2.14 produces warning for value classes which are wrapping case classes in Scala 2.13.0 #11657

@crow-fff

Description

@crow-fff

The following code produces a warning with -Xsource:2.14 (and -deprecation) enabled for the following code:

case class Bar(x: Int)
class Foo(val bar: Bar) extends AnyVal

The warning is:

Auto-application to () is deprecated. Supply the empty argument list () explicitly to invoke method hashCode, or remove the empty argument list from its definition (Java-defined methods are exempt). In Scala 3, an unapplied method like this will be eta-expanded into a function. class Foo(val bar: Bar) extends AnyVal

Seems like the inspection is called on the compiler generated code for AnyVal (and only when the contained value type is some case class) instead of the original one.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions