You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
dietlw@scarab:~/tmp$$ /opt/scala-2.6.1-final/bin/scalac OverrideVal.scala
dietlw@scarab:~/tmp$$ /opt/scala-2.7.0-final/bin/scalac OverrideVal.scala
dietlw@scarab:~/tmp$$ /opt/scala-2.7.1.final/bin/scalac OverrideVal.scala
OverrideVal.scala:6:error: super may be not be used on value o
overridevalo="Ha! "+super.o
^
one error found
Why is this an error now?
The error message text could be changed to something like
"super may not be used on value o".
I did not see an entry in the change logs that would explain this
change of behavior and guess it's an error introduced in 2.7.1.
The text was updated successfully, but these errors were encountered:
Geoffrey Alan Washburn (washburn) said:
This is the intended behavior, and it was changed so that traits could override vals to be more uniform with classes.
I don't know why it didn't make it into the ChangeLog. Probably it was a small item in a larger set of changes someone committed.
wdietl said:
The Scala Reference, page 81, has Example 6.5.1, which does not
compile any more under this changed rule.
(Also the example contains superfluous "}" in classes C and D).
Take the example:
And try compiling it with the different versions:
Why is this an error now?
The error message text could be changed to something like
"super may not be used on value o".
I did not see an entry in the change logs that would explain this
change of behavior and guess it's an error introduced in 2.7.1.
The text was updated successfully, but these errors were encountered: