Browse Source

file descriptors and the syntax field are really weird with proto2

Sydney Acksman 6 years ago
parent
commit
5b2f2c5292
1 changed files with 1 additions and 1 deletions
  1. 1 1
      csharp/src/Google.Protobuf/Reflection/FieldDescriptor.cs

+ 1 - 1
csharp/src/Google.Protobuf/Reflection/FieldDescriptor.cs

@@ -201,7 +201,7 @@ namespace Google.Protobuf.Reflection
         /// <summary>
         /// <summary>
         /// Returns <c>true</c> if this field is a packed, repeated field; <c>false</c> otherwise.
         /// Returns <c>true</c> if this field is a packed, repeated field; <c>false</c> otherwise.
         /// </summary>
         /// </summary>
-        public bool IsPacked => File.Proto.Syntax == "proto2" ? Proto.Options?.Packed ?? false : !Proto.Options.HasPacked || Proto.Options.Packed;
+        public bool IsPacked => File.Proto.Syntax != "proto3" ? Proto.Options?.Packed ?? false : !Proto.Options.HasPacked || Proto.Options.Packed;
 
 
         /// <summary>
         /// <summary>
         /// Returns <c>true</c> if this field extends another message type; <c>false</c> otherwise.
         /// Returns <c>true</c> if this field extends another message type; <c>false</c> otherwise.