From 0dbd5ec80d33ea2a37f5362a24fd72b2c5f51aaa Mon Sep 17 00:00:00 2001 From: Jon Skeet Date: Thu, 23 Jul 2015 15:31:34 +0100 Subject: First attempt at using profile 259 for Google.Protobuf. This requires .NET 4.5, and there are a few compatibility changes required around reflection. Creating a PR from this to see how our CI systems handle it. Will want to add more documentation, validation and probably tests before merging. This is in aid of issue #590. --- csharp/src/Google.Protobuf/Collections/MapField.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'csharp/src/Google.Protobuf/Collections/MapField.cs') diff --git a/csharp/src/Google.Protobuf/Collections/MapField.cs b/csharp/src/Google.Protobuf/Collections/MapField.cs index 9ca5104d..68f2f1cc 100644 --- a/csharp/src/Google.Protobuf/Collections/MapField.cs +++ b/csharp/src/Google.Protobuf/Collections/MapField.cs @@ -35,6 +35,7 @@ using System; using System.Collections; using System.Collections.Generic; using System.Linq; +using Google.Protobuf.Compatibility; namespace Google.Protobuf.Collections { @@ -74,7 +75,7 @@ namespace Google.Protobuf.Collections /// Whether null values are permitted in the map or not. public MapField(bool allowNullValues) { - if (allowNullValues && typeof(TValue).IsValueType && Nullable.GetUnderlyingType(typeof(TValue)) == null) + if (allowNullValues && typeof(TValue).IsValueType() && Nullable.GetUnderlyingType(typeof(TValue)) == null) { throw new ArgumentException("allowNullValues", "Non-nullable value types do not support null values"); } -- cgit v1.2.3