- for msupertype in mclassdef.supertypes do
- # FIXME: the order is quite arbitrary
- if not msupertype.mclass.kind.need_init then continue
- msupertype = msupertype.anchor_to(mmodule, mclassdef.bound_mtype)
- var candidate = modelbuilder.try_get_mproperty_by_name2(self, mmodule, msupertype, mpropdef.mproperty.name)
- if candidate == null then
- candidate = modelbuilder.try_get_mproperty_by_name2(self, mmodule, msupertype, "init")
- end
- if candidate == null then
- modelbuilder.error(self, "Error: Cannot do an implicit constructor call in {mpropdef}; there is no constructor named {mpropdef.mproperty.name} in {msupertype}.")
- return
- end
- assert candidate isa MMethod
-
- # Skip new-style init
- if candidate.is_root_init then continue
-
- var candidatedefs = candidate.lookup_definitions(mmodule, anchor)
- var candidatedef = candidatedefs.first
- # TODO, we drop the others propdefs in the callsite, that is not great :(
-
- var msignature = candidatedef.new_msignature or else candidatedef.msignature
- msignature = msignature.resolve_for(recvtype, anchor, mmodule, true)