twitter/chill — pull request #115 by ryanlecompte (2013-08-08 06:36:42+00:00)
Title: fix for #114: issue with specialized types in WrappedArray instances

This pull request addresses issue #114. The problem is that currently the `WrappedArraySerializer` serializes a `Class[T]` that it gets from the `ClassManifest` via `obj.elemManifest.erasure`. Surprisingly, it turns out that the class returned by this method is not the correct class when the values contained by the `WrappedArray[T]` are specialized types, such as `(Int,Int)` instances. This pull request fixes it (and adds new tests to verify the correct behavior) by using `writeClassAndObject`. The downside is that the class will be serialized with each item, however we do the same thing with other custom serializers, e.g. `TraversableSerializer`. This is probably the safest thing to do because it a) fixes the problem and b) handles the case where it's a `WrappedArray[Any]` and each underlying element has a different type.

@mateiz, @dlyubimov, @rxin