You cannot override it (for reasons that don't reveal themselves to me right now, except, that vars can be modified anyway so why override them), but you can leave the declared variable uninitialised and delegate the latter to B
:
trait A {
var a: Int
}
class B(var a: Int) extends A
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…