Fix issues from interactive rebase and regenerate code

pull/5936/head
Sydney Acksman 6 years ago
parent 5b2f2c5292
commit 011427c9d8
  1. 2
      csharp/src/Google.Protobuf.Test/GeneratedMessageTest.cs
  2. 2
      csharp/src/Google.Protobuf.Test/Reflection/CustomOptionsTest.cs
  3. 534
      csharp/src/Google.Protobuf.Test/TestProtos/TestMessagesProto2.cs
  4. 110
      csharp/src/Google.Protobuf.Test/TestProtos/Unittest.cs
  5. 2
      csharp/src/Google.Protobuf/Extension.cs
  6. 18
      csharp/src/Google.Protobuf/Reflection/Descriptor.cs

@ -240,7 +240,7 @@ namespace Google.Protobuf
Assert.True(message.IsInitialized());
message.RegisterExtension(Proto2.TestRequired.Extensions.Multi);
message.GetOrRegisterExtension(Proto2.TestRequired.Extensions.Multi);
Assert.True(message.IsInitialized());

@ -176,7 +176,7 @@ namespace Google.Protobuf.Test.Reflection
AssertOption(new Aggregate { S = "FieldAnnotation" }, fieldOptions.TryGetMessage, Fieldopt, AggregateMessage.Descriptor.Fields["fieldname"].GetOption);
}
private void AssertOption<T, D>(T expected, OptionFetcher<T> fetcher, Extension<D, T> extension, Func<Extension<D, T>, T> descriptorOptionFetcher) where D : IExtensionMessage<D>
private void AssertOption<T, D>(T expected, OptionFetcher<T> fetcher, Extension<D, T> extension, Func<Extension<D, T>, T> descriptorOptionFetcher) where D : IExtendableMessage<D>
{
T customOptionsValue;
T extensionValue = descriptorOptionFetcher(extension);

@ -25,7 +25,7 @@ namespace ProtobufTestMessages.Proto2 {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"Cipnb29nbGUvcHJvdG9idWYvdGVzdF9tZXNzYWdlc19wcm90bzIucHJvdG8S",
"HXByb3RvYnVmX3Rlc3RfbWVzc2FnZXMucHJvdG8yIt4yChJUZXN0QWxsVHlw",
"HXByb3RvYnVmX3Rlc3RfbWVzc2FnZXMucHJvdG8yIuYyChJUZXN0QWxsVHlw",
"ZXNQcm90bzISFgoOb3B0aW9uYWxfaW50MzIYASABKAUSFgoOb3B0aW9uYWxf",
"aW50NjQYAiABKAMSFwoPb3B0aW9uYWxfdWludDMyGAMgASgNEhcKD29wdGlv",
"bmFsX3VpbnQ2NBgEIAEoBBIXCg9vcHRpb25hbF9zaW50MzIYBSABKBESFwoP",
@ -170,12 +170,19 @@ namespace ProtobufTestMessages.Proto2 {
"ZXMucHJvdG8yLlRlc3RBbGxUeXBlc1Byb3RvMi5NZXNzYWdlU2V0Q29ycmVj",
"dEV4dGVuc2lvbjIiOQoKTmVzdGVkRW51bRIHCgNGT08QABIHCgNCQVIQARIH",
"CgNCQVoQAhIQCgNORUcQ////////////ASoFCHgQyQFCDQoLb25lb2ZfZmll",
"bGQiIQoURm9yZWlnbk1lc3NhZ2VQcm90bzISCQoBYxgBIAEoBSpGChFGb3Jl",
"aWduRW51bVByb3RvMhIPCgtGT1JFSUdOX0ZPTxAAEg8KC0ZPUkVJR05fQkFS",
"EAESDwoLRk9SRUlHTl9CQVoQAjpKCg9leHRlbnNpb25faW50MzISMS5wcm90",
"b2J1Zl90ZXN0X21lc3NhZ2VzLnByb3RvMi5UZXN0QWxsVHlwZXNQcm90bzIY",
"eCABKAVCLwooY29tLmdvb2dsZS5wcm90b2J1Zl90ZXN0X21lc3NhZ2VzLnBy",
"b3RvMkgB+AEB"));
"bGRKBgjoBxCQTiIhChRGb3JlaWduTWVzc2FnZVByb3RvMhIJCgFjGAEgASgF",
"IsECChVVbmtub3duVG9UZXN0QWxsVHlwZXMSFwoOb3B0aW9uYWxfaW50MzIY",
"6QcgASgFEhgKD29wdGlvbmFsX3N0cmluZxjqByABKAkSTAoObmVzdGVkX21l",
"c3NhZ2UY6wcgASgLMjMucHJvdG9idWZfdGVzdF9tZXNzYWdlcy5wcm90bzIu",
"Rm9yZWlnbk1lc3NhZ2VQcm90bzISWgoNb3B0aW9uYWxncm91cBjsByABKAoy",
"Qi5wcm90b2J1Zl90ZXN0X21lc3NhZ2VzLnByb3RvMi5Vbmtub3duVG9UZXN0",
"QWxsVHlwZXMuT3B0aW9uYWxHcm91cBIWCg1vcHRpb25hbF9ib29sGO4HIAEo",
"CBIXCg5yZXBlYXRlZF9pbnQzMhjzByADKAUaGgoNT3B0aW9uYWxHcm91cBIJ",
"CgFhGAEgASgFKkYKEUZvcmVpZ25FbnVtUHJvdG8yEg8KC0ZPUkVJR05fRk9P",
"EAASDwoLRk9SRUlHTl9CQVIQARIPCgtGT1JFSUdOX0JBWhACOkoKD2V4dGVu",
"c2lvbl9pbnQzMhIxLnByb3RvYnVmX3Rlc3RfbWVzc2FnZXMucHJvdG8yLlRl",
"c3RBbGxUeXBlc1Byb3RvMhh4IAEoBUIvCihjb20uZ29vZ2xlLnByb3RvYnVm",
"X3Rlc3RfbWVzc2FnZXMucHJvdG8ySAH4AQE="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { },
new pbr::GeneratedClrTypeInfo(new[] {typeof(global::ProtobufTestMessages.Proto2.ForeignEnumProto2), }, new pb::Extension[] { TestMessagesProto2Extensions.ExtensionInt32 }, new pbr::GeneratedClrTypeInfo[] {
@ -184,7 +191,8 @@ namespace ProtobufTestMessages.Proto2 {
new pbr::GeneratedClrTypeInfo(typeof(global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.MessageSetCorrect), global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.MessageSetCorrect.Parser, null, null, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.MessageSetCorrectExtension1), global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.MessageSetCorrectExtension1.Parser, new[]{ "Str" }, null, null, new pb::Extension[] { global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.MessageSetCorrectExtension1.Extensions.MessageSetExtension }, null),
new pbr::GeneratedClrTypeInfo(typeof(global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.MessageSetCorrectExtension2), global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.MessageSetCorrectExtension2.Parser, new[]{ "I" }, null, null, new pb::Extension[] { global::ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.MessageSetCorrectExtension2.Extensions.MessageSetExtension }, null)}),
new pbr::GeneratedClrTypeInfo(typeof(global::ProtobufTestMessages.Proto2.ForeignMessageProto2), global::ProtobufTestMessages.Proto2.ForeignMessageProto2.Parser, new[]{ "C" }, null, null, null, null)
new pbr::GeneratedClrTypeInfo(typeof(global::ProtobufTestMessages.Proto2.ForeignMessageProto2), global::ProtobufTestMessages.Proto2.ForeignMessageProto2.Parser, new[]{ "C" }, null, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::ProtobufTestMessages.Proto2.UnknownToTestAllTypes), global::ProtobufTestMessages.Proto2.UnknownToTestAllTypes.Parser, new[]{ "OptionalInt32", "OptionalString", "NestedMessage", "OptionalGroup", "OptionalBool", "RepeatedInt32" }, null, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::ProtobufTestMessages.Proto2.UnknownToTestAllTypes.Types.OptionalGroup), global::ProtobufTestMessages.Proto2.UnknownToTestAllTypes.Types.OptionalGroup.Parser, new[]{ "A" }, null, null, null, null)})
}));
}
#endregion
@ -215,7 +223,7 @@ namespace ProtobufTestMessages.Proto2 {
/// could trigger bugs that occur in any message type in this file. We verify
/// this stays true in a unit test.
/// </summary>
public sealed partial class TestAllTypesProto2 : pb::IExtensionMessage<TestAllTypesProto2> {
public sealed partial class TestAllTypesProto2 : pb::IExtendableMessage<TestAllTypesProto2> {
private static readonly pb::MessageParser<TestAllTypesProto2> _parser = new pb::MessageParser<TestAllTypesProto2>(() => new TestAllTypesProto2());
private pb::UnknownFieldSet _unknownFields;
private pb::ExtensionSet<TestAllTypesProto2> _extensions;
@ -3274,15 +3282,15 @@ namespace ProtobufTestMessages.Proto2 {
}
}
public void RegisterExtension(pb::Extension extension) {
pb::ExtensionSet.Register(ref _extensions, extension);
}
public TValue GetExtension<TValue>(pb::Extension<TestAllTypesProto2, TValue> extension) {
return pb::ExtensionSet.Get(ref _extensions, extension);
}
public pbc::RepeatedField<TValue> GetExtension<TValue>(pb::RepeatedExtension<TestAllTypesProto2, TValue> extension) {
return pb::ExtensionSet.Get(ref _extensions, extension);
}
public pbc::RepeatedField<TValue> GetOrRegisterExtension<TValue>(pb::RepeatedExtension<TestAllTypesProto2, TValue> extension) {
return pb::ExtensionSet.GetOrRegister(ref _extensions, extension);
}
public void SetExtension<TValue>(pb::Extension<TestAllTypesProto2, TValue> extension, TValue value) {
pb::ExtensionSet.Set(ref _extensions, extension, value);
}
@ -3292,6 +3300,9 @@ namespace ProtobufTestMessages.Proto2 {
public void ClearExtension<TValue>(pb::Extension<TestAllTypesProto2, TValue> extension) {
pb::ExtensionSet.Clear(ref _extensions, extension);
}
public void ClearExtension<TValue>(pb::RepeatedExtension<TestAllTypesProto2, TValue> extension) {
pb::ExtensionSet.Clear(ref _extensions, extension);
}
#region Nested types
/// <summary>Container for nested types declared in the TestAllTypesProto2 message type.</summary>
@ -3688,7 +3699,7 @@ namespace ProtobufTestMessages.Proto2 {
/// <summary>
/// message_set test case.
/// </summary>
public sealed partial class MessageSetCorrect : pb::IExtensionMessage<MessageSetCorrect> {
public sealed partial class MessageSetCorrect : pb::IExtendableMessage<MessageSetCorrect> {
private static readonly pb::MessageParser<MessageSetCorrect> _parser = new pb::MessageParser<MessageSetCorrect>(() => new MessageSetCorrect());
private pb::UnknownFieldSet _unknownFields;
private pb::ExtensionSet<MessageSetCorrect> _extensions;
@ -3804,15 +3815,15 @@ namespace ProtobufTestMessages.Proto2 {
}
}
public void RegisterExtension(pb::Extension extension) {
pb::ExtensionSet.Register(ref _extensions, extension);
}
public TValue GetExtension<TValue>(pb::Extension<MessageSetCorrect, TValue> extension) {
return pb::ExtensionSet.Get(ref _extensions, extension);
}
public pbc::RepeatedField<TValue> GetExtension<TValue>(pb::RepeatedExtension<MessageSetCorrect, TValue> extension) {
return pb::ExtensionSet.Get(ref _extensions, extension);
}
public pbc::RepeatedField<TValue> GetOrRegisterExtension<TValue>(pb::RepeatedExtension<MessageSetCorrect, TValue> extension) {
return pb::ExtensionSet.GetOrRegister(ref _extensions, extension);
}
public void SetExtension<TValue>(pb::Extension<MessageSetCorrect, TValue> extension, TValue value) {
pb::ExtensionSet.Set(ref _extensions, extension, value);
}
@ -3822,6 +3833,9 @@ namespace ProtobufTestMessages.Proto2 {
public void ClearExtension<TValue>(pb::Extension<MessageSetCorrect, TValue> extension) {
pb::ExtensionSet.Clear(ref _extensions, extension);
}
public void ClearExtension<TValue>(pb::RepeatedExtension<MessageSetCorrect, TValue> extension) {
pb::ExtensionSet.Clear(ref _extensions, extension);
}
}
@ -4277,6 +4291,494 @@ namespace ProtobufTestMessages.Proto2 {
}
public sealed partial class UnknownToTestAllTypes : pb::IMessage<UnknownToTestAllTypes> {
private static readonly pb::MessageParser<UnknownToTestAllTypes> _parser = new pb::MessageParser<UnknownToTestAllTypes>(() => new UnknownToTestAllTypes());
private pb::UnknownFieldSet _unknownFields;
private int _hasBits0;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<UnknownToTestAllTypes> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::ProtobufTestMessages.Proto2.TestMessagesProto2Reflection.Descriptor.MessageTypes[2]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public UnknownToTestAllTypes() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public UnknownToTestAllTypes(UnknownToTestAllTypes other) : this() {
_hasBits0 = other._hasBits0;
optionalInt32_ = other.optionalInt32_;
optionalString_ = other.optionalString_;
nestedMessage_ = other.HasNestedMessage ? other.nestedMessage_.Clone() : null;
optionalGroup_ = other.HasOptionalGroup ? other.optionalGroup_.Clone() : null;
optionalBool_ = other.optionalBool_;
repeatedInt32_ = other.repeatedInt32_.Clone();
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public UnknownToTestAllTypes Clone() {
return new UnknownToTestAllTypes(this);
}
/// <summary>Field number for the "optional_int32" field.</summary>
public const int OptionalInt32FieldNumber = 1001;
private readonly static int OptionalInt32DefaultValue = 0;
private int optionalInt32_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int OptionalInt32 {
get { if ((_hasBits0 & 1) != 0) { return optionalInt32_; } else { return OptionalInt32DefaultValue; } }
set {
_hasBits0 |= 1;
optionalInt32_ = value;
}
}
/// <summary>Gets whether the "optional_int32" field is set</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool HasOptionalInt32 {
get { return (_hasBits0 & 1) != 0; }
}
/// <summary>Clears the value of the "optional_int32" field</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void ClearOptionalInt32() {
_hasBits0 &= ~1;
}
/// <summary>Field number for the "optional_string" field.</summary>
public const int OptionalStringFieldNumber = 1002;
private readonly static string OptionalStringDefaultValue = "";
private string optionalString_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string OptionalString {
get { return optionalString_ ?? OptionalStringDefaultValue; }
set {
optionalString_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Gets whether the "optional_string" field is set</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool HasOptionalString {
get { return optionalString_ != null; }
}
/// <summary>Clears the value of the "optional_string" field</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void ClearOptionalString() {
optionalString_ = null;
}
/// <summary>Field number for the "nested_message" field.</summary>
public const int NestedMessageFieldNumber = 1003;
private global::ProtobufTestMessages.Proto2.ForeignMessageProto2 nestedMessage_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::ProtobufTestMessages.Proto2.ForeignMessageProto2 NestedMessage {
get { return nestedMessage_; }
set {
nestedMessage_ = value;
}
}
/// <summary>Gets whether the nested_message field is set</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool HasNestedMessage {
get { return nestedMessage_ != null; }
}
/// <summary>Clears the value of the nested_message field</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void ClearNestedMessage() {
nestedMessage_ = null;
}
/// <summary>Field number for the "optionalgroup" field.</summary>
public const int OptionalGroupFieldNumber = 1004;
private global::ProtobufTestMessages.Proto2.UnknownToTestAllTypes.Types.OptionalGroup optionalGroup_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::ProtobufTestMessages.Proto2.UnknownToTestAllTypes.Types.OptionalGroup OptionalGroup {
get { return optionalGroup_; }
set {
optionalGroup_ = value;
}
}
/// <summary>Gets whether the optionalgroup field is set</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool HasOptionalGroup {
get { return optionalGroup_ != null; }
}
/// <summary>Clears the value of the optionalgroup field</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void ClearOptionalGroup() {
optionalGroup_ = null;
}
/// <summary>Field number for the "optional_bool" field.</summary>
public const int OptionalBoolFieldNumber = 1006;
private readonly static bool OptionalBoolDefaultValue = false;
private bool optionalBool_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool OptionalBool {
get { if ((_hasBits0 & 2) != 0) { return optionalBool_; } else { return OptionalBoolDefaultValue; } }
set {
_hasBits0 |= 2;
optionalBool_ = value;
}
}
/// <summary>Gets whether the "optional_bool" field is set</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool HasOptionalBool {
get { return (_hasBits0 & 2) != 0; }
}
/// <summary>Clears the value of the "optional_bool" field</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void ClearOptionalBool() {
_hasBits0 &= ~2;
}
/// <summary>Field number for the "repeated_int32" field.</summary>
public const int RepeatedInt32FieldNumber = 1011;
private static readonly pb::FieldCodec<int> _repeated_repeatedInt32_codec
= pb::FieldCodec.ForInt32(8088);
private readonly pbc::RepeatedField<int> repeatedInt32_ = new pbc::RepeatedField<int>();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<int> RepeatedInt32 {
get { return repeatedInt32_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as UnknownToTestAllTypes);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(UnknownToTestAllTypes other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (OptionalInt32 != other.OptionalInt32) return false;
if (OptionalString != other.OptionalString) return false;
if (!object.Equals(NestedMessage, other.NestedMessage)) return false;
if (!object.Equals(OptionalGroup, other.OptionalGroup)) return false;
if (OptionalBool != other.OptionalBool) return false;
if(!repeatedInt32_.Equals(other.repeatedInt32_)) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (HasOptionalInt32) hash ^= OptionalInt32.GetHashCode();
if (HasOptionalString) hash ^= OptionalString.GetHashCode();
if (HasNestedMessage) hash ^= NestedMessage.GetHashCode();
if (HasOptionalGroup) hash ^= OptionalGroup.GetHashCode();
if (HasOptionalBool) hash ^= OptionalBool.GetHashCode();
hash ^= repeatedInt32_.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (HasOptionalInt32) {
output.WriteRawTag(200, 62);
output.WriteInt32(OptionalInt32);
}
if (HasOptionalString) {
output.WriteRawTag(210, 62);
output.WriteString(OptionalString);
}
if (HasNestedMessage) {
output.WriteRawTag(218, 62);
output.WriteMessage(NestedMessage);
}
if (HasOptionalGroup) {
output.WriteRawTag(227, 62);
output.WriteGroup(OptionalGroup);
output.WriteRawTag(228, 62);
}
if (HasOptionalBool) {
output.WriteRawTag(240, 62);
output.WriteBool(OptionalBool);
}
repeatedInt32_.WriteTo(output, _repeated_repeatedInt32_codec);
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (HasOptionalInt32) {
size += 2 + pb::CodedOutputStream.ComputeInt32Size(OptionalInt32);
}
if (HasOptionalString) {
size += 2 + pb::CodedOutputStream.ComputeStringSize(OptionalString);
}
if (HasNestedMessage) {
size += 2 + pb::CodedOutputStream.ComputeMessageSize(NestedMessage);
}
if (HasOptionalGroup) {
size += 4 + pb::CodedOutputStream.ComputeGroupSize(OptionalGroup);
}
if (HasOptionalBool) {
size += 2 + 1;
}
size += repeatedInt32_.CalculateSize(_repeated_repeatedInt32_codec);
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(UnknownToTestAllTypes other) {
if (other == null) {
return;
}
if (other.HasOptionalInt32) {
OptionalInt32 = other.OptionalInt32;
}
if (other.HasOptionalString) {
OptionalString = other.OptionalString;
}
if (other.HasNestedMessage) {
if (!HasNestedMessage) {
NestedMessage = new global::ProtobufTestMessages.Proto2.ForeignMessageProto2();
}
NestedMessage.MergeFrom(other.NestedMessage);
}
if (other.HasOptionalGroup) {
if (!HasOptionalGroup) {
OptionalGroup = new global::ProtobufTestMessages.Proto2.UnknownToTestAllTypes.Types.OptionalGroup();
}
OptionalGroup.MergeFrom(other.OptionalGroup);
}
if (other.HasOptionalBool) {
OptionalBool = other.OptionalBool;
}
repeatedInt32_.Add(other.repeatedInt32_);
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 8008: {
OptionalInt32 = input.ReadInt32();
break;
}
case 8018: {
OptionalString = input.ReadString();
break;
}
case 8026: {
if (!HasNestedMessage) {
NestedMessage = new global::ProtobufTestMessages.Proto2.ForeignMessageProto2();
}
input.ReadMessage(NestedMessage);
break;
}
case 8035: {
if (!HasOptionalGroup) {
OptionalGroup = new global::ProtobufTestMessages.Proto2.UnknownToTestAllTypes.Types.OptionalGroup();
}
input.ReadGroup(OptionalGroup);
break;
}
case 8048: {
OptionalBool = input.ReadBool();
break;
}
case 8090:
case 8088: {
repeatedInt32_.AddEntriesFrom(input, _repeated_repeatedInt32_codec);
break;
}
}
}
}
#region Nested types
/// <summary>Container for nested types declared in the UnknownToTestAllTypes message type.</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static partial class Types {
public sealed partial class OptionalGroup : pb::IMessage<OptionalGroup> {
private static readonly pb::MessageParser<OptionalGroup> _parser = new pb::MessageParser<OptionalGroup>(() => new OptionalGroup());
private pb::UnknownFieldSet _unknownFields;
private int _hasBits0;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<OptionalGroup> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::ProtobufTestMessages.Proto2.UnknownToTestAllTypes.Descriptor.NestedTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public OptionalGroup() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public OptionalGroup(OptionalGroup other) : this() {
_hasBits0 = other._hasBits0;
a_ = other.a_;
_unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public OptionalGroup Clone() {
return new OptionalGroup(this);
}
/// <summary>Field number for the "a" field.</summary>
public const int AFieldNumber = 1;
private readonly static int ADefaultValue = 0;
private int a_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int A {
get { if ((_hasBits0 & 1) != 0) { return a_; } else { return ADefaultValue; } }
set {
_hasBits0 |= 1;
a_ = value;
}
}
/// <summary>Gets whether the "a" field is set</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool HasA {
get { return (_hasBits0 & 1) != 0; }
}
/// <summary>Clears the value of the "a" field</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void ClearA() {
_hasBits0 &= ~1;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as OptionalGroup);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(OptionalGroup other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (A != other.A) return false;
return Equals(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (HasA) hash ^= A.GetHashCode();
if (_unknownFields != null) {
hash ^= _unknownFields.GetHashCode();
}
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (HasA) {
output.WriteRawTag(8);
output.WriteInt32(A);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (HasA) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(A);
}
if (_unknownFields != null) {
size += _unknownFields.CalculateSize();
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(OptionalGroup other) {
if (other == null) {
return;
}
if (other.HasA) {
A = other.A;
}
_unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
case 8036:
return;
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
break;
case 8: {
A = input.ReadInt32();
break;
}
}
}
}
}
}
#endregion
}
#endregion
}

@ -5135,7 +5135,7 @@ namespace Google.Protobuf.TestProtos.Proto2 {
}
public sealed partial class TestAllExtensions : pb::IExtensionMessage<TestAllExtensions> {
public sealed partial class TestAllExtensions : pb::IExtendableMessage<TestAllExtensions> {
private static readonly pb::MessageParser<TestAllExtensions> _parser = new pb::MessageParser<TestAllExtensions>(() => new TestAllExtensions());
private pb::UnknownFieldSet _unknownFields;
private pb::ExtensionSet<TestAllExtensions> _extensions;
@ -5251,15 +5251,15 @@ namespace Google.Protobuf.TestProtos.Proto2 {
}
}
public void RegisterExtension(pb::Extension extension) {
pb::ExtensionSet.Register(ref _extensions, extension);
}
public TValue GetExtension<TValue>(pb::Extension<TestAllExtensions, TValue> extension) {
return pb::ExtensionSet.Get(ref _extensions, extension);
}
public pbc::RepeatedField<TValue> GetExtension<TValue>(pb::RepeatedExtension<TestAllExtensions, TValue> extension) {
return pb::ExtensionSet.Get(ref _extensions, extension);
}
public pbc::RepeatedField<TValue> GetOrRegisterExtension<TValue>(pb::RepeatedExtension<TestAllExtensions, TValue> extension) {
return pb::ExtensionSet.GetOrRegister(ref _extensions, extension);
}
public void SetExtension<TValue>(pb::Extension<TestAllExtensions, TValue> extension, TValue value) {
pb::ExtensionSet.Set(ref _extensions, extension, value);
}
@ -5269,6 +5269,9 @@ namespace Google.Protobuf.TestProtos.Proto2 {
public void ClearExtension<TValue>(pb::Extension<TestAllExtensions, TValue> extension) {
pb::ExtensionSet.Clear(ref _extensions, extension);
}
public void ClearExtension<TValue>(pb::RepeatedExtension<TestAllExtensions, TValue> extension) {
pb::ExtensionSet.Clear(ref _extensions, extension);
}
}
@ -5902,7 +5905,7 @@ namespace Google.Protobuf.TestProtos.Proto2 {
}
public sealed partial class TestGroupExtension : pb::IExtensionMessage<TestGroupExtension> {
public sealed partial class TestGroupExtension : pb::IExtendableMessage<TestGroupExtension> {
private static readonly pb::MessageParser<TestGroupExtension> _parser = new pb::MessageParser<TestGroupExtension>(() => new TestGroupExtension());
private pb::UnknownFieldSet _unknownFields;
private pb::ExtensionSet<TestGroupExtension> _extensions;
@ -6018,15 +6021,15 @@ namespace Google.Protobuf.TestProtos.Proto2 {
}
}
public void RegisterExtension(pb::Extension extension) {
pb::ExtensionSet.Register(ref _extensions, extension);
}
public TValue GetExtension<TValue>(pb::Extension<TestGroupExtension, TValue> extension) {
return pb::ExtensionSet.Get(ref _extensions, extension);
}
public pbc::RepeatedField<TValue> GetExtension<TValue>(pb::RepeatedExtension<TestGroupExtension, TValue> extension) {
return pb::ExtensionSet.Get(ref _extensions, extension);
}
public pbc::RepeatedField<TValue> GetOrRegisterExtension<TValue>(pb::RepeatedExtension<TestGroupExtension, TValue> extension) {
return pb::ExtensionSet.GetOrRegister(ref _extensions, extension);
}
public void SetExtension<TValue>(pb::Extension<TestGroupExtension, TValue> extension, TValue value) {
pb::ExtensionSet.Set(ref _extensions, extension, value);
}
@ -6036,6 +6039,9 @@ namespace Google.Protobuf.TestProtos.Proto2 {
public void ClearExtension<TValue>(pb::Extension<TestGroupExtension, TValue> extension) {
pb::ExtensionSet.Clear(ref _extensions, extension);
}
public void ClearExtension<TValue>(pb::RepeatedExtension<TestGroupExtension, TValue> extension) {
pb::ExtensionSet.Clear(ref _extensions, extension);
}
}
@ -8467,7 +8473,7 @@ namespace Google.Protobuf.TestProtos.Proto2 {
/// Like above, but declare all field numbers as potential extensions. No
/// actual extensions should ever be defined for this type.
/// </summary>
public sealed partial class TestEmptyMessageWithExtensions : pb::IExtensionMessage<TestEmptyMessageWithExtensions> {
public sealed partial class TestEmptyMessageWithExtensions : pb::IExtendableMessage<TestEmptyMessageWithExtensions> {
private static readonly pb::MessageParser<TestEmptyMessageWithExtensions> _parser = new pb::MessageParser<TestEmptyMessageWithExtensions>(() => new TestEmptyMessageWithExtensions());
private pb::UnknownFieldSet _unknownFields;
private pb::ExtensionSet<TestEmptyMessageWithExtensions> _extensions;
@ -8583,15 +8589,15 @@ namespace Google.Protobuf.TestProtos.Proto2 {
}
}
public void RegisterExtension(pb::Extension extension) {
pb::ExtensionSet.Register(ref _extensions, extension);
}
public TValue GetExtension<TValue>(pb::Extension<TestEmptyMessageWithExtensions, TValue> extension) {
return pb::ExtensionSet.Get(ref _extensions, extension);
}
public pbc::RepeatedField<TValue> GetExtension<TValue>(pb::RepeatedExtension<TestEmptyMessageWithExtensions, TValue> extension) {
return pb::ExtensionSet.Get(ref _extensions, extension);
}
public pbc::RepeatedField<TValue> GetOrRegisterExtension<TValue>(pb::RepeatedExtension<TestEmptyMessageWithExtensions, TValue> extension) {
return pb::ExtensionSet.GetOrRegister(ref _extensions, extension);
}
public void SetExtension<TValue>(pb::Extension<TestEmptyMessageWithExtensions, TValue> extension, TValue value) {
pb::ExtensionSet.Set(ref _extensions, extension, value);
}
@ -8601,10 +8607,13 @@ namespace Google.Protobuf.TestProtos.Proto2 {
public void ClearExtension<TValue>(pb::Extension<TestEmptyMessageWithExtensions, TValue> extension) {
pb::ExtensionSet.Clear(ref _extensions, extension);
}
public void ClearExtension<TValue>(pb::RepeatedExtension<TestEmptyMessageWithExtensions, TValue> extension) {
pb::ExtensionSet.Clear(ref _extensions, extension);
}
}
public sealed partial class TestMultipleExtensionRanges : pb::IExtensionMessage<TestMultipleExtensionRanges> {
public sealed partial class TestMultipleExtensionRanges : pb::IExtendableMessage<TestMultipleExtensionRanges> {
private static readonly pb::MessageParser<TestMultipleExtensionRanges> _parser = new pb::MessageParser<TestMultipleExtensionRanges>(() => new TestMultipleExtensionRanges());
private pb::UnknownFieldSet _unknownFields;
private pb::ExtensionSet<TestMultipleExtensionRanges> _extensions;
@ -8720,15 +8729,15 @@ namespace Google.Protobuf.TestProtos.Proto2 {
}
}
public void RegisterExtension(pb::Extension extension) {
pb::ExtensionSet.Register(ref _extensions, extension);
}
public TValue GetExtension<TValue>(pb::Extension<TestMultipleExtensionRanges, TValue> extension) {
return pb::ExtensionSet.Get(ref _extensions, extension);
}
public pbc::RepeatedField<TValue> GetExtension<TValue>(pb::RepeatedExtension<TestMultipleExtensionRanges, TValue> extension) {
return pb::ExtensionSet.Get(ref _extensions, extension);
}
public pbc::RepeatedField<TValue> GetOrRegisterExtension<TValue>(pb::RepeatedExtension<TestMultipleExtensionRanges, TValue> extension) {
return pb::ExtensionSet.GetOrRegister(ref _extensions, extension);
}
public void SetExtension<TValue>(pb::Extension<TestMultipleExtensionRanges, TValue> extension, TValue value) {
pb::ExtensionSet.Set(ref _extensions, extension, value);
}
@ -8738,6 +8747,9 @@ namespace Google.Protobuf.TestProtos.Proto2 {
public void ClearExtension<TValue>(pb::Extension<TestMultipleExtensionRanges, TValue> extension) {
pb::ExtensionSet.Clear(ref _extensions, extension);
}
public void ClearExtension<TValue>(pb::RepeatedExtension<TestMultipleExtensionRanges, TValue> extension) {
pb::ExtensionSet.Clear(ref _extensions, extension);
}
}
@ -11910,7 +11922,7 @@ namespace Google.Protobuf.TestProtos.Proto2 {
/// We list fields out of order, to ensure that we're using field number and not
/// field index to determine serialization order.
/// </summary>
public sealed partial class TestFieldOrderings : pb::IExtensionMessage<TestFieldOrderings> {
public sealed partial class TestFieldOrderings : pb::IExtendableMessage<TestFieldOrderings> {
private static readonly pb::MessageParser<TestFieldOrderings> _parser = new pb::MessageParser<TestFieldOrderings>(() => new TestFieldOrderings());
private pb::UnknownFieldSet _unknownFields;
private pb::ExtensionSet<TestFieldOrderings> _extensions;
@ -12194,15 +12206,15 @@ namespace Google.Protobuf.TestProtos.Proto2 {
}
}
public void RegisterExtension(pb::Extension extension) {
pb::ExtensionSet.Register(ref _extensions, extension);
}
public TValue GetExtension<TValue>(pb::Extension<TestFieldOrderings, TValue> extension) {
return pb::ExtensionSet.Get(ref _extensions, extension);
}
public pbc::RepeatedField<TValue> GetExtension<TValue>(pb::RepeatedExtension<TestFieldOrderings, TValue> extension) {
return pb::ExtensionSet.Get(ref _extensions, extension);
}
public pbc::RepeatedField<TValue> GetOrRegisterExtension<TValue>(pb::RepeatedExtension<TestFieldOrderings, TValue> extension) {
return pb::ExtensionSet.GetOrRegister(ref _extensions, extension);
}
public void SetExtension<TValue>(pb::Extension<TestFieldOrderings, TValue> extension, TValue value) {
pb::ExtensionSet.Set(ref _extensions, extension, value);
}
@ -12212,6 +12224,9 @@ namespace Google.Protobuf.TestProtos.Proto2 {
public void ClearExtension<TValue>(pb::Extension<TestFieldOrderings, TValue> extension) {
pb::ExtensionSet.Clear(ref _extensions, extension);
}
public void ClearExtension<TValue>(pb::RepeatedExtension<TestFieldOrderings, TValue> extension) {
pb::ExtensionSet.Clear(ref _extensions, extension);
}
#region Nested types
/// <summary>Container for nested types declared in the TestFieldOrderings message type.</summary>
@ -19220,7 +19235,7 @@ namespace Google.Protobuf.TestProtos.Proto2 {
}
public sealed partial class TestPackedExtensions : pb::IExtensionMessage<TestPackedExtensions> {
public sealed partial class TestPackedExtensions : pb::IExtendableMessage<TestPackedExtensions> {
private static readonly pb::MessageParser<TestPackedExtensions> _parser = new pb::MessageParser<TestPackedExtensions>(() => new TestPackedExtensions());
private pb::UnknownFieldSet _unknownFields;
private pb::ExtensionSet<TestPackedExtensions> _extensions;
@ -19336,15 +19351,15 @@ namespace Google.Protobuf.TestProtos.Proto2 {
}
}
public void RegisterExtension(pb::Extension extension) {
pb::ExtensionSet.Register(ref _extensions, extension);
}
public TValue GetExtension<TValue>(pb::Extension<TestPackedExtensions, TValue> extension) {
return pb::ExtensionSet.Get(ref _extensions, extension);
}
public pbc::RepeatedField<TValue> GetExtension<TValue>(pb::RepeatedExtension<TestPackedExtensions, TValue> extension) {
return pb::ExtensionSet.Get(ref _extensions, extension);
}
public pbc::RepeatedField<TValue> GetOrRegisterExtension<TValue>(pb::RepeatedExtension<TestPackedExtensions, TValue> extension) {
return pb::ExtensionSet.GetOrRegister(ref _extensions, extension);
}
public void SetExtension<TValue>(pb::Extension<TestPackedExtensions, TValue> extension, TValue value) {
pb::ExtensionSet.Set(ref _extensions, extension, value);
}
@ -19354,10 +19369,13 @@ namespace Google.Protobuf.TestProtos.Proto2 {
public void ClearExtension<TValue>(pb::Extension<TestPackedExtensions, TValue> extension) {
pb::ExtensionSet.Clear(ref _extensions, extension);
}
public void ClearExtension<TValue>(pb::RepeatedExtension<TestPackedExtensions, TValue> extension) {
pb::ExtensionSet.Clear(ref _extensions, extension);
}
}
public sealed partial class TestUnpackedExtensions : pb::IExtensionMessage<TestUnpackedExtensions> {
public sealed partial class TestUnpackedExtensions : pb::IExtendableMessage<TestUnpackedExtensions> {
private static readonly pb::MessageParser<TestUnpackedExtensions> _parser = new pb::MessageParser<TestUnpackedExtensions>(() => new TestUnpackedExtensions());
private pb::UnknownFieldSet _unknownFields;
private pb::ExtensionSet<TestUnpackedExtensions> _extensions;
@ -19473,15 +19491,15 @@ namespace Google.Protobuf.TestProtos.Proto2 {
}
}
public void RegisterExtension(pb::Extension extension) {
pb::ExtensionSet.Register(ref _extensions, extension);
}
public TValue GetExtension<TValue>(pb::Extension<TestUnpackedExtensions, TValue> extension) {
return pb::ExtensionSet.Get(ref _extensions, extension);
}
public pbc::RepeatedField<TValue> GetExtension<TValue>(pb::RepeatedExtension<TestUnpackedExtensions, TValue> extension) {
return pb::ExtensionSet.Get(ref _extensions, extension);
}
public pbc::RepeatedField<TValue> GetOrRegisterExtension<TValue>(pb::RepeatedExtension<TestUnpackedExtensions, TValue> extension) {
return pb::ExtensionSet.GetOrRegister(ref _extensions, extension);
}
public void SetExtension<TValue>(pb::Extension<TestUnpackedExtensions, TValue> extension, TValue value) {
pb::ExtensionSet.Set(ref _extensions, extension, value);
}
@ -19491,6 +19509,9 @@ namespace Google.Protobuf.TestProtos.Proto2 {
public void ClearExtension<TValue>(pb::Extension<TestUnpackedExtensions, TValue> extension) {
pb::ExtensionSet.Clear(ref _extensions, extension);
}
public void ClearExtension<TValue>(pb::RepeatedExtension<TestUnpackedExtensions, TValue> extension) {
pb::ExtensionSet.Clear(ref _extensions, extension);
}
}
@ -20256,7 +20277,7 @@ namespace Google.Protobuf.TestProtos.Proto2 {
/// Test that if an optional or required message/group field appears multiple
/// times in the input, they need to be merged.
/// </summary>
public sealed partial class TestParsingMerge : pb::IExtensionMessage<TestParsingMerge> {
public sealed partial class TestParsingMerge : pb::IExtendableMessage<TestParsingMerge> {
private static readonly pb::MessageParser<TestParsingMerge> _parser = new pb::MessageParser<TestParsingMerge>(() => new TestParsingMerge());
private pb::UnknownFieldSet _unknownFields;
private pb::ExtensionSet<TestParsingMerge> _extensions;
@ -20545,15 +20566,15 @@ namespace Google.Protobuf.TestProtos.Proto2 {
}
}
public void RegisterExtension(pb::Extension extension) {
pb::ExtensionSet.Register(ref _extensions, extension);
}
public TValue GetExtension<TValue>(pb::Extension<TestParsingMerge, TValue> extension) {
return pb::ExtensionSet.Get(ref _extensions, extension);
}
public pbc::RepeatedField<TValue> GetExtension<TValue>(pb::RepeatedExtension<TestParsingMerge, TValue> extension) {
return pb::ExtensionSet.Get(ref _extensions, extension);
}
public pbc::RepeatedField<TValue> GetOrRegisterExtension<TValue>(pb::RepeatedExtension<TestParsingMerge, TValue> extension) {
return pb::ExtensionSet.GetOrRegister(ref _extensions, extension);
}
public void SetExtension<TValue>(pb::Extension<TestParsingMerge, TValue> extension, TValue value) {
pb::ExtensionSet.Set(ref _extensions, extension, value);
}
@ -20563,6 +20584,9 @@ namespace Google.Protobuf.TestProtos.Proto2 {
public void ClearExtension<TValue>(pb::Extension<TestParsingMerge, TValue> extension) {
pb::ExtensionSet.Clear(ref _extensions, extension);
}
public void ClearExtension<TValue>(pb::RepeatedExtension<TestParsingMerge, TValue> extension) {
pb::ExtensionSet.Clear(ref _extensions, extension);
}
#region Nested types
/// <summary>Container for nested types declared in the TestParsingMerge message type.</summary>
@ -22529,7 +22553,7 @@ namespace Google.Protobuf.TestProtos.Proto2 {
}
public sealed partial class TestHugeFieldNumbers : pb::IExtensionMessage<TestHugeFieldNumbers> {
public sealed partial class TestHugeFieldNumbers : pb::IExtendableMessage<TestHugeFieldNumbers> {
private static readonly pb::MessageParser<TestHugeFieldNumbers> _parser = new pb::MessageParser<TestHugeFieldNumbers>(() => new TestHugeFieldNumbers());
private pb::UnknownFieldSet _unknownFields;
private pb::ExtensionSet<TestHugeFieldNumbers> _extensions;
@ -23206,15 +23230,15 @@ namespace Google.Protobuf.TestProtos.Proto2 {
}
}
public void RegisterExtension(pb::Extension extension) {
pb::ExtensionSet.Register(ref _extensions, extension);
}
public TValue GetExtension<TValue>(pb::Extension<TestHugeFieldNumbers, TValue> extension) {
return pb::ExtensionSet.Get(ref _extensions, extension);
}
public pbc::RepeatedField<TValue> GetExtension<TValue>(pb::RepeatedExtension<TestHugeFieldNumbers, TValue> extension) {
return pb::ExtensionSet.Get(ref _extensions, extension);
}
public pbc::RepeatedField<TValue> GetOrRegisterExtension<TValue>(pb::RepeatedExtension<TestHugeFieldNumbers, TValue> extension) {
return pb::ExtensionSet.GetOrRegister(ref _extensions, extension);
}
public void SetExtension<TValue>(pb::Extension<TestHugeFieldNumbers, TValue> extension, TValue value) {
pb::ExtensionSet.Set(ref _extensions, extension, value);
}
@ -23224,6 +23248,9 @@ namespace Google.Protobuf.TestProtos.Proto2 {
public void ClearExtension<TValue>(pb::Extension<TestHugeFieldNumbers, TValue> extension) {
pb::ExtensionSet.Clear(ref _extensions, extension);
}
public void ClearExtension<TValue>(pb::RepeatedExtension<TestHugeFieldNumbers, TValue> extension) {
pb::ExtensionSet.Clear(ref _extensions, extension);
}
#region Nested types
/// <summary>Container for nested types declared in the TestHugeFieldNumbers message type.</summary>
@ -23380,7 +23407,7 @@ namespace Google.Protobuf.TestProtos.Proto2 {
}
public sealed partial class TestExtensionInsideTable : pb::IExtensionMessage<TestExtensionInsideTable> {
public sealed partial class TestExtensionInsideTable : pb::IExtendableMessage<TestExtensionInsideTable> {
private static readonly pb::MessageParser<TestExtensionInsideTable> _parser = new pb::MessageParser<TestExtensionInsideTable>(() => new TestExtensionInsideTable());
private pb::UnknownFieldSet _unknownFields;
private pb::ExtensionSet<TestExtensionInsideTable> _extensions;
@ -23867,15 +23894,15 @@ namespace Google.Protobuf.TestProtos.Proto2 {
}
}
public void RegisterExtension(pb::Extension extension) {
pb::ExtensionSet.Register(ref _extensions, extension);
}
public TValue GetExtension<TValue>(pb::Extension<TestExtensionInsideTable, TValue> extension) {
return pb::ExtensionSet.Get(ref _extensions, extension);
}
public pbc::RepeatedField<TValue> GetExtension<TValue>(pb::RepeatedExtension<TestExtensionInsideTable, TValue> extension) {
return pb::ExtensionSet.Get(ref _extensions, extension);
}
public pbc::RepeatedField<TValue> GetOrRegisterExtension<TValue>(pb::RepeatedExtension<TestExtensionInsideTable, TValue> extension) {
return pb::ExtensionSet.GetOrRegister(ref _extensions, extension);
}
public void SetExtension<TValue>(pb::Extension<TestExtensionInsideTable, TValue> extension, TValue value) {
pb::ExtensionSet.Set(ref _extensions, extension, value);
}
@ -23885,6 +23912,9 @@ namespace Google.Protobuf.TestProtos.Proto2 {
public void ClearExtension<TValue>(pb::Extension<TestExtensionInsideTable, TValue> extension) {
pb::ExtensionSet.Clear(ref _extensions, extension);
}
public void ClearExtension<TValue>(pb::RepeatedExtension<TestExtensionInsideTable, TValue> extension) {
pb::ExtensionSet.Clear(ref _extensions, extension);
}
}

@ -79,8 +79,6 @@ namespace Google.Protobuf
internal override Type TargetType => typeof(TTarget);
internal TValue DefaultValue => codec.DefaultValue;
internal override IExtensionValue CreateValue()
{
return new ExtensionValue<TValue>(codec);

@ -1587,7 +1587,7 @@ namespace Google.Protobuf.Reflection {
}
internal sealed partial class ExtensionRangeOptions : pb::IExtendableMessage<ExtensionRangeOptions> {
public sealed partial class ExtensionRangeOptions : pb::IExtendableMessage<ExtensionRangeOptions> {
private static readonly pb::MessageParser<ExtensionRangeOptions> _parser = new pb::MessageParser<ExtensionRangeOptions>(() => new ExtensionRangeOptions());
private pb::UnknownFieldSet _unknownFields;
internal pb::ExtensionSet<ExtensionRangeOptions> _extensions;
@ -3815,7 +3815,7 @@ namespace Google.Protobuf.Reflection {
}
internal sealed partial class FileOptions : pb::IExtendableMessage<FileOptions> {
public sealed partial class FileOptions : pb::IExtendableMessage<FileOptions> {
private static readonly pb::MessageParser<FileOptions> _parser = new pb::MessageParser<FileOptions>(() => new FileOptions());
private pb::UnknownFieldSet _unknownFields;
internal pb::ExtensionSet<FileOptions> _extensions;
@ -4912,7 +4912,7 @@ namespace Google.Protobuf.Reflection {
}
internal sealed partial class MessageOptions : pb::IExtendableMessage<MessageOptions> {
public sealed partial class MessageOptions : pb::IExtendableMessage<MessageOptions> {
private static readonly pb::MessageParser<MessageOptions> _parser = new pb::MessageParser<MessageOptions>(() => new MessageOptions());
private pb::UnknownFieldSet _unknownFields;
internal pb::ExtensionSet<MessageOptions> _extensions;
@ -5295,7 +5295,7 @@ namespace Google.Protobuf.Reflection {
}
internal sealed partial class FieldOptions : pb::IExtendableMessage<FieldOptions> {
public sealed partial class FieldOptions : pb::IExtendableMessage<FieldOptions> {
private static readonly pb::MessageParser<FieldOptions> _parser = new pb::MessageParser<FieldOptions>(() => new FieldOptions());
private pb::UnknownFieldSet _unknownFields;
internal pb::ExtensionSet<FieldOptions> _extensions;
@ -5801,7 +5801,7 @@ namespace Google.Protobuf.Reflection {
}
internal sealed partial class OneofOptions : pb::IExtendableMessage<OneofOptions> {
public sealed partial class OneofOptions : pb::IExtendableMessage<OneofOptions> {
private static readonly pb::MessageParser<OneofOptions> _parser = new pb::MessageParser<OneofOptions>(() => new OneofOptions());
private pb::UnknownFieldSet _unknownFields;
internal pb::ExtensionSet<OneofOptions> _extensions;
@ -5964,7 +5964,7 @@ namespace Google.Protobuf.Reflection {
}
internal sealed partial class EnumOptions : pb::IExtendableMessage<EnumOptions> {
public sealed partial class EnumOptions : pb::IExtendableMessage<EnumOptions> {
private static readonly pb::MessageParser<EnumOptions> _parser = new pb::MessageParser<EnumOptions>(() => new EnumOptions());
private pb::UnknownFieldSet _unknownFields;
internal pb::ExtensionSet<EnumOptions> _extensions;
@ -6221,7 +6221,7 @@ namespace Google.Protobuf.Reflection {
}
internal sealed partial class EnumValueOptions : pb::IExtendableMessage<EnumValueOptions> {
public sealed partial class EnumValueOptions : pb::IExtendableMessage<EnumValueOptions> {
private static readonly pb::MessageParser<EnumValueOptions> _parser = new pb::MessageParser<EnumValueOptions>(() => new EnumValueOptions());
private pb::UnknownFieldSet _unknownFields;
internal pb::ExtensionSet<EnumValueOptions> _extensions;
@ -6433,7 +6433,7 @@ namespace Google.Protobuf.Reflection {
}
internal sealed partial class ServiceOptions : pb::IExtendableMessage<ServiceOptions> {
public sealed partial class ServiceOptions : pb::IExtendableMessage<ServiceOptions> {
private static readonly pb::MessageParser<ServiceOptions> _parser = new pb::MessageParser<ServiceOptions>(() => new ServiceOptions());
private pb::UnknownFieldSet _unknownFields;
internal pb::ExtensionSet<ServiceOptions> _extensions;
@ -6645,7 +6645,7 @@ namespace Google.Protobuf.Reflection {
}
internal sealed partial class MethodOptions : pb::IExtendableMessage<MethodOptions> {
public sealed partial class MethodOptions : pb::IExtendableMessage<MethodOptions> {
private static readonly pb::MessageParser<MethodOptions> _parser = new pb::MessageParser<MethodOptions>(() => new MethodOptions());
private pb::UnknownFieldSet _unknownFields;
internal pb::ExtensionSet<MethodOptions> _extensions;

Loading…
Cancel
Save