typing: use `location` attribute instead of `node` to isolate CallSite from the AST
[nit.git] / src / semantize / auto_super_init.nit
index cb4b70a..1da19d4 100644 (file)
@@ -73,13 +73,6 @@ redef class AMethPropdef
                        return
                end
 
-               # Do we inherit for a constructor?
-               var skip = true
-               for cd in mclassdef.in_hierarchy.direct_greaters do
-                       if cd.mclass.kind.need_init then skip = false
-               end
-               if skip then return
-
                # Now we search for the absence of any explicit super-init invocation
                #  * via a "super"
                #  * via a call of an other init
@@ -134,7 +127,7 @@ redef class AMethPropdef
                        var msignature = candidatedef.new_msignature or else candidatedef.msignature
                        msignature = msignature.resolve_for(recvtype, anchor, mmodule, true)
 
-                       var callsite = new CallSite(self, recvtype, mmodule, anchor, true, candidate, candidatedef, msignature, false)
+                       var callsite = new CallSite(hot_location, recvtype, mmodule, anchor, true, candidate, candidatedef, msignature, false)
                        auto_super_inits.add(callsite)
                        modelbuilder.toolcontext.info("Old-style auto-super init for {mpropdef} to {candidate.full_name}", 4)
                end
@@ -169,7 +162,7 @@ redef class AMethPropdef
                        var msignature = candidatedef.new_msignature or else candidatedef.msignature
                        msignature = msignature.resolve_for(recvtype, anchor, mmodule, true)
 
-                       var callsite = new CallSite(self, recvtype, mmodule, anchor, true, the_root_init_mmethod, candidatedef, msignature, false)
+                       var callsite = new CallSite(hot_location, recvtype, mmodule, anchor, true, the_root_init_mmethod, candidatedef, msignature, false)
                        auto_super_inits.add(callsite)
                        modelbuilder.toolcontext.info("Auto-super init for {mpropdef} to {the_root_init_mmethod.full_name}", 4)
                end