type MyType = ref object of RootObj
p_attrib: int
method attrib*(obj: MyType): int =
result = obj.p_attrib
method `attrib=`*(obj: var MyType, value: int) =
obj.p_attrib = value
var x: MyType
x.new
echo x.attrib
x.attrib = 5
echo x.attrib
type SubType = ref object of MyType
var y: SubType
y.new
echo y.attrib
y.attrib = 9
echo y.attrib