You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ICollection<T> and IList<T> do not implement IList. The concrete types do, but the interfaces do not.
So it seems to me we should check against IList and ICollection<T> where T is the element type and then cast the result to the correct one.
I can submit a fix if this is something you'd take. I didn't actually run into this in my own code, so it's not urgent to me. But it's something I realized as I was thinking about the various cases.
The text was updated successfully, but these errors were encountered:
I would personally be fine with merging it in (especially if it is just few changes to the codebase).
But I don't see any reason why someone would want to implement IList<T>. (SimpleJson is really meant to do simple things. POCOs should be enough. With .NET extension methods one can easily sort of extend IList<T>.)
If you do run into a situation where you might need it, let us know and we can look into merging it.
This is related to #36.
I wondered what would happen if you manually implemented a list like so:
Turns out that fails to deserialize even if the list is a property of another object. The reason is in this code:
Specifically this clause:
ICollection<T>
andIList<T>
do not implementIList
. The concrete types do, but the interfaces do not.So it seems to me we should check against
IList
andICollection<T>
whereT
is the element type and then cast the result to the correct one.I can submit a fix if this is something you'd take. I didn't actually run into this in my own code, so it's not urgent to me. But it's something I realized as I was thinking about the various cases.
The text was updated successfully, but these errors were encountered: