From: Alexis Laferrière Date: Tue, 30 Aug 2016 13:37:25 +0000 (-0400) Subject: frontend/serialization: leave missing attributes to their default value X-Git-Url: http://nitlanguage.org frontend/serialization: leave missing attributes to their default value Signed-off-by: Alexis Laferrière --- diff --git a/src/frontend/serialization_phase.nit b/src/frontend/serialization_phase.nit index 3a1c9f5..7fc1c31 100644 --- a/src/frontend/serialization_phase.nit +++ b/src/frontend/serialization_phase.nit @@ -314,7 +314,8 @@ do """ else code.add """ var {{{name}}} = v.deserialize_attribute("{{{attribute.serialize_name}}}", "{{{type_name}}}") - if not {{{name}}} isa {{{type_name}}} then + if v.deserialize_attribute_missing then + else if not {{{name}}} isa {{{type_name}}} then v.errors.add new AttributeTypeError(self, "{{{attribute.serialize_name}}}", {{{name}}}, "{{{type_name}}}") if v.keep_going == false then return else