Open oyvindberg opened 3 years ago
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.
When did Scala-2's behavior change?
In https://github.com/scala/scala/commit/9b59f5f9530d54c917479c6bf44aa3007ba0a2df 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 }
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