init init_asuperclass (
n_kwspecial: nullable TKwspecial,
+ n_kwsuper: nullable TKwsuper,
n_type: nullable AType
)
do
empty_init
- _n_kwspecial = n_kwspecial.as(not null)
- n_kwspecial.parent = self
+ _n_kwspecial = n_kwspecial
+ if n_kwspecial != null then
+ n_kwspecial.parent = self
+ end
+ _n_kwsuper = n_kwsuper
+ if n_kwsuper != null then
+ n_kwsuper.parent = self
+ end
_n_type = n_type.as(not null)
n_type.parent = self
end
assert new_child isa TKwspecial
_n_kwspecial = new_child
else
- abort
+ _n_kwspecial = null
+ end
+ return
+ end
+ if _n_kwsuper == old_child then
+ if new_child != null then
+ new_child.parent = self
+ assert new_child isa TKwsuper
+ _n_kwsuper = new_child
+ else
+ _n_kwsuper = null
end
return
end
redef fun visit_all(v: Visitor)
do
- v.enter_visit(_n_kwspecial)
+ if _n_kwspecial != null then
+ v.enter_visit(_n_kwspecial.as(not null))
+ end
+ if _n_kwsuper != null then
+ v.enter_visit(_n_kwsuper.as(not null))
+ end
v.enter_visit(_n_type)
end
end