-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
area:desugarDesugaring happens after parsing but before typing, see desugar.scalaDesugaring happens after parsing but before typing, see desugar.scalaarea:reportingError reporting including formatting, implicit suggestions, etcError reporting including formatting, implicit suggestions, etcitype:enhancement
Description
% scala -version
Scala code runner version 3.1.1 -- Copyright 2002-2022, LAMP/EPFL
Case class allows case-field with name productArity without any warning/error. This silently breaks functionality of Product.
It is not obvious that case class extends Product and field with productArity should not be used.
Suggestion: make productArity illegal as a case-field or at least warning.
Example:
object Bug {
case class Problem(productArity : Int)
def main(args : Array[String]) : Unit = {
val cc = Problem(42)
println("wtf?: "+cc.productArity) //42
}
}
He-Pin and michelou
Metadata
Metadata
Assignees
Labels
area:desugarDesugaring happens after parsing but before typing, see desugar.scalaDesugaring happens after parsing but before typing, see desugar.scalaarea:reportingError reporting including formatting, implicit suggestions, etcError reporting including formatting, implicit suggestions, etcitype:enhancement