TIL one can override vars in Scala, after all. You just need to pass -Yoverride-vars
-
-
Replying to @jaguarul
if you like living dangerously. it's unfinished, and much likelier to get removed than finished
3 replies 0 retweets 0 likes -
Replying to @SethTisue
I think it’s the other way around. The feature was there until it was put behind a flag. Because of issues with the old inliner
2 replies 0 retweets 0 likes -
Replying to @jaguarul
@propensive you must be thinking of ancient Scala. 2.7, 2.8, 2.9 don't allow it; flag added in 2.10. cf https://github.com/scala/scala/commit/399bd6240f775583ee9709311bd0b02e8359c15c …3 replies 0 retweets 0 likes -
Replying to @SethTisue @propensive
You’re probably right. It would be interesting to know why it’s forbidden though.
1 reply 0 retweets 0 likes -
Replying to @jaguarul @SethTisue
I can't remember. Could it be issues with overriding `def foo_=(x)` XOR `def foo`?
1 reply 0 retweets 0 likes -
you're only overriding the accessors; can't affect which class has the backing field, nor its type
1 reply 0 retweets 1 like -
Indeed. That’s what I would expect, given that vars are specced as equivalent to getter+setter.
1 reply 0 retweets 0 likes -
Is there a type theoretic reason to forbid it though?
2 replies 0 retweets 0 likes
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.