| Index: third_party/protobuf/csharp/src/Google.Protobuf/FieldCodec.cs
|
| diff --git a/third_party/protobuf/csharp/src/Google.Protobuf/FieldCodec.cs b/third_party/protobuf/csharp/src/Google.Protobuf/FieldCodec.cs
|
| index c28b47e1eb76f327d3461623db6f6290da850091..9831308882b08e9fdd7b67bdd38b3c48c06d3dc2 100644
|
| --- a/third_party/protobuf/csharp/src/Google.Protobuf/FieldCodec.cs
|
| +++ b/third_party/protobuf/csharp/src/Google.Protobuf/FieldCodec.cs
|
| @@ -347,8 +347,7 @@ namespace Google.Protobuf
|
| public sealed class FieldCodec<T>
|
| {
|
| private static readonly T DefaultDefault;
|
| - // Only non-nullable value types support packing. This is the simplest way of detecting that.
|
| - private static readonly bool TypeSupportsPacking = default(T) != null;
|
| + private static readonly bool TypeSupportsPacking = typeof(T).IsValueType() && Nullable.GetUnderlyingType(typeof(T)) == null;
|
|
|
| static FieldCodec()
|
| {
|
|
|