nitlanguage
/
nit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f9e9728
)
frontend: don't type check values for attributes typed with `nullable Object`
author
Alexis Laferrière
<alexis.laf@xymus.net>
Thu, 4 Aug 2016 13:45:11 +0000
(09:45 -0400)
committer
Alexis 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
patch
|
blob
|
history
diff --git
a/src/frontend/serialization_phase.nit
b/src/frontend/serialization_phase.nit
index
8b3de28
..
ddb0cce
100644
(file)
--- 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