-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deserialize lists that directly implement list interfaces #38
Comments
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 If you do run into a situation where you might need it, let us know and we can look into merging it. |
Maybe they're not the ones implementing it. Suppose you have an object with a property of type Now, I don't have this problem and I think 99% of folks won't, so I'm happy to ignore this until someone asks for 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: