-
Notifications
You must be signed in to change notification settings - Fork 21
compiler doesn't allow to define matching .apply manually #10383
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
Comments
You're on 2.12.1, but this wasn't allowed until 2.12.2. |
@SethTisue can you elaborate? this part has existed at least in 2.11: https://www.scala-lang.org/files/archive/spec/2.11/05-classes-and-objects.html#case-classes |
it was added in 2.11.11; see https://github.com/scala/scala/releases/tag/v2.11.11. 2.12.2 includes all the 2.11.9/2.11.10/2.11.11 changes; see https://github.com/scala/scala/releases/tag/v2.12.2 in 2.12.2, you can do it by default, but in 2.11.11, a late decision was made to put it behind |
note that in general, it isn't valid to reason that everything you see in any 2.11.x release is also present in every 2.12.x release. some 2.11.x releases are newer than some 2.12.x releases |
following code generates error, which is not expected:
from the specification:
obviously, I am defining a matching
.apply
, hence the compiler shouldn't complain and simply accept my definition, instead of adding another definition of.apply
. this behavior doesn't comply to the specification.The text was updated successfully, but these errors were encountered: