Why am I able to redefine a var in subclass with a def and another def. Why compiler doesn't complain?
abstract class Person {
var age: Int
}
class Employee extends Person {
def age = 5 // does not allow override def age = 5, though
def age_=(a: Int) = {
age = a // infinite recursion
}
}
related to Why it's impossible to override var
with def
in Scala?