-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
override modifier not allowed for abstract vars #18692
Comments
I would assume that this should behave like in Scala 2, as the spec for 2.13 reads:
therefore one would assume that var desugars to ordinary methods and so can be overridden |
Yes, but it's not trivial. Maybe someone could look how it was done in Scala 2 and re-implement it for 3? |
Relatedly #13019 (where the casual tweak was reverted) |
lets also close this as duplicate of #13019 |
Compiler version
3.3.0
Minimized code
This works in scala 2, but it doesn't in scala 3
While this one is fine in both:
Output
Also there is a problem with concrete vars:
Minimized code
This ones returns
override modifier required to override concrete member:
But when I add override modifier it gives another error
mutable variable cannot be overridden
|The text was updated successfully, but these errors were encountered: