src: Update init
[nit.git] / src / nitni / nitni_callbacks.nit
index 4543308..c9725d0 100644 (file)
@@ -219,7 +219,7 @@ class MExplicitCall
 
                        var cname
                        if mproperty.is_init then
-                               if mproperty.name == "init" or mproperty.name == "new" or mproperty.name == "autoinit" then
+                               if mproperty.name == "init" or mproperty.name == "new" or mproperty.name == "defaultinit" then
                                        cname = "new_{recv_mtype.mangled_cname}"
                                else
                                        cname = "new_{recv_mtype.mangled_cname}_{mproperty.short_cname}"
@@ -304,7 +304,7 @@ redef class AFullPropExternCall
                var mmodule = npropdef.mpropdef.mclassdef.mmodule
                var mclassdef = npropdef.mpropdef.mclassdef
                var mclass_type = mclassdef.bound_mtype
-               var mtype = toolcontext.modelbuilder.resolve_mtype(mmodule, mclassdef, n_type)
+               var mtype = toolcontext.modelbuilder.resolve_mtype(mclassdef, n_type)
 
                if mtype == null then return
 
@@ -337,7 +337,7 @@ redef class AInitPropExternCall
        do
                var mmodule = npropdef.mpropdef.mclassdef.mmodule
                var mclassdef = npropdef.mpropdef.mclassdef
-               var mtype = toolcontext.modelbuilder.resolve_mtype(mmodule, mclassdef, n_type)
+               var mtype = toolcontext.modelbuilder.resolve_mtype(mclassdef, n_type)
                if mtype == null then return
 
                if not mtype isa MClassType then
@@ -350,7 +350,7 @@ redef class AInitPropExternCall
                        mmodule, mtype, meth_name )
 
                if meth == null then
-                       meth_name = "autoinit"
+                       meth_name = "defaultinit"
                        meth = toolcontext.modelbuilder.try_get_mproperty_by_name2( self,
                                mmodule, mtype, meth_name )
                end
@@ -398,9 +398,8 @@ redef class ACastAsExternCall
        redef fun verify_and_collect(npropdef, callback_set, toolcontext)
        do
                var mclassdef = npropdef.mpropdef.mclassdef
-               var mmodule = mclassdef.mmodule
-               toolcontext.modelbuilder.resolve_mtype_unchecked(mmodule, mclassdef, n_from_type, true)
-               toolcontext.modelbuilder.resolve_mtype_unchecked(mmodule, mclassdef, n_to_type, true)
+               toolcontext.modelbuilder.resolve_mtype_unchecked(mclassdef, n_from_type, true)
+               toolcontext.modelbuilder.resolve_mtype_unchecked(mclassdef, n_to_type, true)
                super
        end
 end
@@ -412,8 +411,7 @@ redef class AAsNullableExternCall
        redef fun verify_and_collect(npropdef, callback_set, toolcontext)
        do
                var mclassdef = npropdef.mpropdef.mclassdef
-               var mmodule = mclassdef.mmodule
-               toolcontext.modelbuilder.resolve_mtype_unchecked(mmodule, mclassdef, n_type, true)
+               toolcontext.modelbuilder.resolve_mtype_unchecked(mclassdef, n_type, true)
                super
        end
 end
@@ -429,8 +427,7 @@ redef class AAsNotNullableExternCall
        redef fun verify_and_collect(npropdef, callback_set, toolcontext)
        do
                var mclassdef = npropdef.mpropdef.mclassdef
-               var mmodule = mclassdef.mmodule
-               toolcontext.modelbuilder.resolve_mtype_unchecked(mmodule, mclassdef, n_type, true)
+               toolcontext.modelbuilder.resolve_mtype_unchecked(mclassdef, n_type, true)
                super
        end
 end