Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
-Xsource:2.14 produces warning for value classes which are wrapping case classes in Scala 2.13.0 #11657
The following code produces a warning with
case class Bar(x: Int) class Foo(val bar: Bar) extends AnyVal
The warning is:
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.
The usage of macros is controlled by its user, while a compiler's synthetic code appears out of regular language constructs, and I don't understand why a user should see warnings about this code if there are any.
I'm on team goose-gander as well.
I think nice that the typechecking or whatever the feature is following the same logic for synthetically generated code. Of course, from the language user's point of view, it's not nice that there's a warning at all, but if there were magical situation where some generated code skipped through the safety rules, I think it would be in a different level of not-niceness when things fail.
We can't always predict these feature interactions, but here we are with two fix PRs.