+ # This method returns the list of possible candidates for the current definition.
+ #
+ # Warning this method supports super call from old_style_init to default_inits without signature verification!!!
+ private fun get_super_candidatedefs(modelbuilder: ModelBuilder): Array[MMethodDef]
+ do
+ var candidatedefs = new Array[MMethodDef]
+
+ var mclassdef = self.parent.as(AClassdef).mclassdef
+ if mclassdef == null or mclassdef.is_broken then return candidatedefs # skip error
+ var mpropdef = self.mpropdef
+ if mpropdef == null or mpropdef.is_broken then return candidatedefs # skip error
+ var mmodule = mpropdef.mclassdef.mmodule
+ var anchor = mclassdef.bound_mtype
+ var mproperty = mpropdef.mproperty
+
+ # The look for new-style super constructors (called from a old style constructor)
+ var the_root_init_mmethod = modelbuilder.the_root_init_mmethod
+
+ if mpropdef.is_old_style_init then
+ var superprop: nullable MMethodDef = null
+ for mclass in mclassdef.mclass.in_hierarchy(mmodule).direct_greaters do
+ candidatedefs.add(mclass.intro.default_init.as(not null))
+ end
+ else
+ candidatedefs = the_root_init_mmethod.lookup_definitions(mmodule, anchor)
+ end
+ return candidatedefs
+ end