From: Alexis Laferrière Date: Thu, 4 Aug 2016 13:45:11 +0000 (-0400) Subject: frontend: don't type check values for attributes typed with `nullable Object` X-Git-Url: http://nitlanguage.org frontend: don't type check values for attributes typed with `nullable Object` Signed-off-by: Alexis Laferrière --- diff --git a/src/frontend/serialization_phase.nit b/src/frontend/serialization_phase.nit index 8b3de28..ddb0cce 100644 --- a/src/frontend/serialization_phase.nit +++ b/src/frontend/serialization_phase.nit @@ -245,7 +245,12 @@ do end var name = attribute.name - code.add """ + if type_name == "nullable Object" then + # Don't type check + code.add """ + var {{{name}}} = v.deserialize_attribute("{{{attribute.serialize_name}}}") +""" + else code.add """ var {{{name}}} = v.deserialize_attribute("{{{attribute.serialize_name}}}") if not {{{name}}} isa {{{type_name}}} then # Check if it was a subjectent error