Merge: lib/github: implements caching to maximize rate limit.
[nit.git] / src / semantize / auto_super_init.nit
index 31a508a..b16eaf5 100644 (file)
@@ -14,7 +14,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# Computing of super-constructors that must be implicitely called at the begin of constructors.
+# Computing of super-constructors that must be implicitly called at the begin of constructors.
 # The current rules are a bit crazy but whatever.
 module auto_super_init
 
@@ -22,6 +22,7 @@ import typing
 private import annotation
 
 redef class ToolContext
+       # Phase that inject `super` in constructors that need it.
        var auto_super_init_phase: Phase = new AutoSuperInitPhase(self, [typing_phase])
 end
 
@@ -65,7 +66,7 @@ redef class AMethPropdef
                var nosuper = get_single_annotation("nosuper", modelbuilder)
 
                # Collect only for constructors
-               if not mpropdef.mproperty.is_init then
+               if not mpropdef.mproperty.is_init or mpropdef.mproperty.is_new then
                        if nosuper != null then modelbuilder.error(nosuper, "Error: nosuper only in `init`")
                        return
                end