- if anode == null then anode = nclassdef
-
- if combine.is_empty and inhc != null then
- if not mparameters.is_empty then
- self.error(anode,"Error: {mclassdef} cannot inherit constructors from {inhc} because there is attributes without initial values: {mparameters.join(", ")}")
- return
- end
-
- # TODO: actively inherit the consturctor
- self.toolcontext.info("{mclassdef} inherits all constructors from {inhc}", 3)
- #mclassdef.mclass.inherit_init_from = inhc
- #return
- end
-
- if not combine.is_empty and inhc != null then
- self.error(nclassdef, "Error: Cannot provide a defaut constructor: conflict for {combine.join(", ")} and {inhc}")
- return
- end
- if not combine.is_empty then
- if mparameters.is_empty and combine.length == 1 then
- # No need to create a local init, the inherited one is enough
- inhc = combine.first.intro_mclassdef.mclass
- mclassdef.mclass.inherit_init_from = inhc
- self.toolcontext.info("{mclassdef} inherits all constructors from {inhc}", 3)
- return
- end
- nclassdef.super_inits = combine
- var mprop = new MMethod(mclassdef, "init", mclassdef.mclass.visibility)
- var mpropdef = new MMethodDef(mclassdef, mprop, nclassdef.location)
- var msignature = new MSignature(mparameters, null)
- mpropdef.msignature = msignature
- mprop.is_init = true
- nclassdef.mfree_init = mpropdef
- self.toolcontext.info("{mclassdef} gets a free empty constructor {mpropdef}{msignature}", 3)
- return
- end