diff options
Diffstat (limited to 'csharp/src/Google.Protobuf/Compatibility/TypeExtensions.cs')
-rw-r--r-- | csharp/src/Google.Protobuf/Compatibility/TypeExtensions.cs | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/csharp/src/Google.Protobuf/Compatibility/TypeExtensions.cs b/csharp/src/Google.Protobuf/Compatibility/TypeExtensions.cs index fe9cda8d..2d93183b 100644 --- a/csharp/src/Google.Protobuf/Compatibility/TypeExtensions.cs +++ b/csharp/src/Google.Protobuf/Compatibility/TypeExtensions.cs @@ -33,6 +33,7 @@ using System; using System.Reflection; +#if !DOTNET35 namespace Google.Protobuf.Compatibility { /// <summary> @@ -46,20 +47,6 @@ namespace Google.Protobuf.Compatibility internal static class TypeExtensions { /// <summary> - /// Returns true if the target type is a value type, including a nullable value type or an enum, or false - /// if it's a reference type (class, delegate, interface - including System.ValueType and System.Enum). - /// </summary> -#if DOTNET35 - internal static bool IsValueType(this Type target) { - return target.IsValueType; - } -#else - internal static bool IsValueType(this Type target) - { - return target.GetTypeInfo().IsValueType; - } - - /// <summary> /// See https://msdn.microsoft.com/en-us/library/system.type.isassignablefrom /// </summary> internal static bool IsAssignableFrom(this Type target, Type c) @@ -114,6 +101,6 @@ namespace Google.Protobuf.Compatibility } return null; } -#endif } } +#endif |