-Added support for serializing const fields

-Fixed tests
This commit is contained in:
James Newton-King
2015-01-11 16:54:10 +13:00
parent 9a4f96aa8f
commit 6c1e1bfcba
10 changed files with 90 additions and 20 deletions
@@ -814,12 +814,8 @@ namespace Newtonsoft.Json.Serialization
}
else
{
// can't populate something like an IEnumerable
if (!arrayContract.CanDeserialize)
{
reader.Skip();
return existingValue;
}
throw JsonSerializationException.Create(reader, "Cannot populate list type {0}.".FormatWith(CultureInfo.InvariantCulture, contract.CreatedType));
value = PopulateList((arrayContract.ShouldCreateWrapper) ? arrayContract.CreateWrapper(existingValue) : (IList)existingValue, reader, arrayContract, member, id);
}