engine: skip noinit attributes on free constructors
authorJean Privat <jean@pryen.org>
Mon, 21 Jul 2014 14:57:43 +0000 (10:57 -0400)
committerJean Privat <jean@pryen.org>
Mon, 21 Jul 2014 14:57:43 +0000 (10:57 -0400)
Signed-off-by: Jean Privat <jean@pryen.org>

src/abstract_compiler.nit
src/naive_interpreter.nit

index 1296ddb..c4ddcb0 100644 (file)
@@ -2081,7 +2081,7 @@ redef class AClassdef
                        var i = 1
                        # Collect undefined attributes
                        for npropdef in self.n_propdefs do
-                               if npropdef isa AAttrPropdef and npropdef.n_expr == null then
+                               if npropdef isa AAttrPropdef and npropdef.n_expr == null and not npropdef.noinit then
                                        v.write_attribute(npropdef.mpropdef.mproperty, recv, arguments[i])
                                        i += 1
                                end
index fc6cbfc..ba2fb39 100644 (file)
@@ -1031,7 +1031,7 @@ redef class AClassdef
                var i = 1
                # Collect undefined attributes
                for npropdef in self.n_propdefs do
-                       if npropdef isa AAttrPropdef and npropdef.n_expr == null then
+                       if npropdef isa AAttrPropdef and not npropdef.noinit and npropdef.n_expr == null then
                                v.write_attribute(npropdef.mpropdef.mproperty, recv, args[i])
                                i += 1
                        end