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
unadvertised change to case class weight due to copy method #5009
Comments
Imported From: https://issues.scala-lang.org/browse/SI-5009?orig=1 |
@paulp said: |
@adriaanm said: but, now we have a copy method: |
@paulp said: case class Foo(x: Int)(y: Int, z: Int) {
<synthetic> def copy(x: Int = this.x) = new Foo(x)(_: Int, _: Int)
} |
@adriaanm said (edited on May 8, 2012 3:10:33 PM UTC): |
@lrytz said: |
@lrytz said: |
@lrytz said: |
Tushar Kapila (tgkprog) said: |
In scala 2.7, this class had one field. In scala 2.8 and beyond, it has three.
I'm pretty sure that using parameter lists beyond the first has been an advertised way of avoiding field creation for case class parameters. This was undone, since the copy method references all the parameters in all the lists and so fields are created.
You can somewhat distastefully get around this by inhibiting the creation of the copy method.
This business should at least be documented.
The text was updated successfully, but these errors were encountered: