-Fixed deserializing non-generic IReadOnlyCollection<T> implementations

This commit is contained in:
James Newton-King
2014-05-12 13:40:48 +12:00
parent 7a8f5e43bc
commit 017a38c65b
5 changed files with 56 additions and 4 deletions
@@ -127,7 +127,7 @@ namespace Newtonsoft.Json.Serialization
#if !(NET40 || NET35 || NET20 || PORTABLE40)
else if (ReflectionUtils.ImplementsGenericDefinition(underlyingType, typeof(IReadOnlyCollection<>), out tempCollectionType))
{
CollectionItemType = underlyingType.GetGenericArguments()[0];
CollectionItemType = tempCollectionType.GetGenericArguments()[0];
if (ReflectionUtils.IsGenericDefinition(underlyingType, typeof(IReadOnlyCollection<>))
|| ReflectionUtils.IsGenericDefinition(underlyingType, typeof(IReadOnlyList<>)))