-
Notifications
You must be signed in to change notification settings - Fork 21
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
Wrong error message when using copy on case class with by-name parameter in second parameters list #7879
Comments
Imported From: https://issues.scala-lang.org/browse/SI-7879?orig=1 |
@paulp said: "while without by-nameness the error is more clear" That's because it's a different error. In that case there is a copy method. |
@OlegYch said: |
@paulp said: |
@lrytz said: i see that we don't generate copy when there's a by-name (https://github.com/scala/scala/blob/master/src/compiler/scala/tools/nsc/typechecker/Unapplies.scala#L186), but i don't remember why.. it should be either changed, or added to the spec |
In 2.11.12, 2.12.11, and 2.13.2 REPL, I get the following (with variation in error format, but same exact message). scala> case class UploadingFile(fid: String, name: String, length: Long, uploaded: Boolean)(onFileProcessingEnd: => String)
class UploadingFile
scala> val f = UploadingFile("", "", 0, true)("")
val f: UploadingFile = UploadingFile(,,0,true)
scala> println(f.copy(uploaded = true)())
^
error: value copy is not a member of UploadingFile
^
error: not found: value uploaded |
I don't think we want to spec this, as Dotty does not have the restriction:
and I've removed the "good first issue" label since the other choice, namely lifting the restriction in Scala 2, is probably neither easy nor especially important to tackle thanks, @nogurenn, for taking a look 👍 |
btw why there is no default arguments now?
i've seen https://github.com/scala/scala-dist/pull/52/files but not sure what prompted that
The text was updated successfully, but these errors were encountered: