frontend: don't type check values for attributes typed with `nullable Object`
authorAlexis Laferrière <alexis.laf@xymus.net>
Thu, 4 Aug 2016 13:45:11 +0000 (09:45 -0400)
committerAlexis Laferrière <alexis.laf@xymus.net>
Thu, 4 Aug 2016 14:27:19 +0000 (10:27 -0400)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

src/frontend/serialization_phase.nit

index 8b3de28..ddb0cce 100644 (file)
@@ -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