chill icon indicating copy to clipboard operation
chill copied to clipboard

serializing a mutable.Map with a default value loses the default value

Open dirkgr opened this issue 10 years ago • 2 comments

I have some sample code here: https://gist.github.com/dirkgr/bc0e8b547015db9e67c7

In short, the code creates a scala.collections.mutable.HashMap and adds a default value. When round-tripping it through a chill file, it loses the default value.

dirkgr avatar Mar 14 '15 00:03 dirkgr

It seems this is serialized by TraversableSerializer, which ignores the default value.

dirkgr avatar Mar 14 '15 00:03 dirkgr

Thanks for the bug-report. It would be good to fix this. I guess other maps may have the same issue, but defaults are just not that often used.

johnynek avatar Mar 31 '15 20:03 johnynek