Closed
Description
case class MyClass(v1: Int, v2: Int, v3: Int) extends Product3[Int, Int, Int]
{ def _1: Int = v1
def _2: Int = v2
def _3: Int = v3
}
error] -- [E120] Naming Error: /Common/s2dotty/src/P4.scala:4:6 -----------------------
[error] 4 |{ def _1: Int = v1
[error] | ^
[error] | Double definition:
[error] | def _1: => Int in class MyClass at line 3 and
[error] | def _1: => Int in class MyClass at line 4
[error] | have the same type after erasure.
To be able to compile to Scala 2 and dotty without error. I'm guessing Dotty is automatically creating the _n properties. This would be great except those properties have to be defined explicitly for code cross compiling to 2.13.
Simple project to show this here