Merge: Serialization fixes and hardening
authorJean Privat <jean@pryen.org>
Mon, 8 Aug 2016 22:23:42 +0000 (18:23 -0400)
committerJean Privat <jean@pryen.org>
Mon, 8 Aug 2016 22:23:42 +0000 (18:23 -0400)
commita70f3007e01a5026cc536616843c6af8e11ff0a1
tree4da3b2e0410ed813e617ec329a8dee50f3181707
parent28469417414c9df76b43bc4a635fc01a09674123
parentb53fd58b01aff8dd56988045dc86d957f8d204ab
Merge: Serialization fixes and hardening

Improve the serialization services on multiple points:

* Fix JSON serialization of `DefaultMap` by writing its attributes. (Not only the "special" length, keys and values)
* Remove type casts and the like that would crash the program on invalid format of collections and maps, raise errors instead and return an empty instance.
* Improve (from horrible to bad) the type name used in deserialization errors when the type of an attribute is not in the AST. (This is pretty much the best we can do without moving the serialization phase after the model has been built.)
* Fix a test which failed on silent errors, and print errors so it doesn't happen again. Note that the errors with nitce are expected as it doesn't have the same `class_name` than the other engines.
* Update nitserial to silence `property-conflict` warnings in the generated module. This effectively hides the conflicts between the JSON and binary serialization because all conflicts are on generic types.

Pull-Request: #2234
Reviewed-by: Jean Privat <jean@pryen.org>