-
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
Confusing behaviour with abstract var
and override
#13019
Comments
I submitted a quickie PR. override of abstract var is fine. |
The fix in #13744 was not semantically correct. When did Scala-2's behavior change? I tried with 2.13.5 and it also flags overrides of variables as errors. |
In scala/scala@9b59f5f which is part of 2.12.0. I tried it in both 2.12.0 and 2.13.5 and could get the following code to compile: trait NotOk { var i: Int }
class NotOkC extends NotOk { override var i: Int = 1 } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Compiler version
3.0.0
Minimized code
Output
Expectation
override
is used to implement abstract or re-implement concrete things, and guarantees their presence. In this case it seems impossible to useoverride
to implement an abstractvar
.The example compiles in scala 2
The text was updated successfully, but these errors were encountered: