import typing
import modelbuilder
+import phase
+
+redef class ToolContext
+ var auto_super_init_phase: Phase = new AutoSuperInitPhase(self, [typing_phase])
+end
+
+private class AutoSuperInitPhase
+ super Phase
+ redef fun process_npropdef(npropdef) do if npropdef isa AConcreteMethPropdef then npropdef.do_auto_super_init(toolcontext.modelbuilder)
+end
private class AutoSuperInitVisitor
super Visitor
redef fun visit(n)
do
- if n == null then return
n.accept_auto_super_init(self)
n.visit_all(self)
end
redef class ASendExpr
redef fun accept_auto_super_init(v)
do
- var mproperty = self.mproperty
+ var mproperty = self.callsite.mproperty
if mproperty == null then return
if mproperty.is_init then
v.has_explicit_super_init = true