file descriptors and the syntax field are really weird with proto2

This commit is contained in:
Sydney Acksman 2019-03-23 15:11:52 -05:00
parent 8e917d1688
commit 5b2f2c5292

View File

@ -201,7 +201,7 @@ namespace Google.Protobuf.Reflection
/// <summary>
/// Returns <c>true</c> if this field is a packed, repeated field; <c>false</c> otherwise.
/// </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>
/// Returns <c>true</c> if this field extends another message type; <c>false</c> otherwise.