If the intention is to override the var
with a subtype of the type defined in the parent class: that would result in an unsound type system. The child type could be used as the parent class, and a set
to a non-subtype performed. More concretely,
class1 := class:
var Data:[]int = ()
class2 := class(class1):
var Data:tuple(int, int) = (1, 2)
Main():void =
X:class2 = class2{}
Y:class1 = X
set Y.Data = (1, 2, 3) # unsound
If the intention is to change the default value of the var
: this works currently.