SharpYaml icon indicating copy to clipboard operation
SharpYaml copied to clipboard

Support for System Immutable collection types

Open ite-klass opened this issue 5 years ago • 1 comments
trafficstars

The System.Collections.Immutable namespace contains immutable collection types.

Given the usefulness of immutable types for strong usage contracts and being able to depend on data passed by reference not mutating it would be great for SharpYaml to support serialization and deserialization of these collection types like it does for arrays.

Currently attempting to deserialize them throws an exception InvalidOperationException: Cannot deserialize list to readonly collection type [System.Collections.Immutable.ImmutableArray1[Subtype]].`

ite-klass avatar Jul 06 '20 10:07 ite-klass

It'd be nice for C#9 Records to work as well, looks like this isn't supported here either just like the base fork issue: https://github.com/aaubry/YamlDotNet/issues/571

michael-hawker avatar Apr 14 '22 23:04 michael-hawker