From 5449e31ec1655289f64ec98b07c9d12c574c358c Mon Sep 17 00:00:00 2001 From: Jean Privat Date: Mon, 21 Jul 2014 10:57:43 -0400 Subject: [PATCH] engine: skip noinit attributes on free constructors Signed-off-by: Jean Privat --- src/abstract_compiler.nit | 2 +- src/naive_interpreter.nit | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/abstract_compiler.nit b/src/abstract_compiler.nit index 1296ddb..c4ddcb0 100644 --- a/src/abstract_compiler.nit +++ b/src/abstract_compiler.nit @@ -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 diff --git a/src/naive_interpreter.nit b/src/naive_interpreter.nit index fc6cbfc..ba2fb39 100644 --- a/src/naive_interpreter.nit +++ b/src/naive_interpreter.nit @@ -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 -- 1.7.9.5