aboutsummaryrefslogtreecommitdiff
path: root/csharp/src/ProtocolBuffers/DescriptorProtos/PartialClasses.cs
diff options
context:
space:
mode:
Diffstat (limited to 'csharp/src/ProtocolBuffers/DescriptorProtos/PartialClasses.cs')
-rw-r--r--csharp/src/ProtocolBuffers/DescriptorProtos/PartialClasses.cs38
1 files changed, 10 insertions, 28 deletions
diff --git a/csharp/src/ProtocolBuffers/DescriptorProtos/PartialClasses.cs b/csharp/src/ProtocolBuffers/DescriptorProtos/PartialClasses.cs
index 15f339ba..dc19cdad 100644
--- a/csharp/src/ProtocolBuffers/DescriptorProtos/PartialClasses.cs
+++ b/csharp/src/ProtocolBuffers/DescriptorProtos/PartialClasses.cs
@@ -30,36 +30,18 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endregion
-// This file just contains partial classes for each of the
-// autogenerated classes, so that they implement
-// IDescriptorProto
+// This file just contains partial classes for any autogenerated classes that need additional support.
namespace Google.Protobuf.DescriptorProtos
{
- public partial class DescriptorProto : IDescriptorProto<MessageOptions>
- {
- }
-
- public partial class EnumDescriptorProto : IDescriptorProto<EnumOptions>
- {
- }
-
- public partial class EnumValueDescriptorProto : IDescriptorProto<EnumValueOptions>
- {
- }
-
- public partial class FieldDescriptorProto : IDescriptorProto<FieldOptions>
- {
- }
-
- public partial class FileDescriptorProto : IDescriptorProto<FileOptions>
- {
- }
-
- public partial class MethodDescriptorProto : IDescriptorProto<MethodOptions>
- {
- }
-
- public partial class ServiceDescriptorProto : IDescriptorProto<ServiceOptions>
+ internal partial class FieldDescriptorProto
{
+ // We can't tell the difference between "explicitly set to 0" and "not set"
+ // in proto3, but we need to tell the difference for OneofIndex. descriptor.proto
+ // is really a proto2 file, but the runtime doesn't know about proto2 semantics...
+ // We fake it by defaulting to -1.
+ partial void OnConstruction()
+ {
+ OneofIndex = -1;
+ }
}
} \ No newline at end of file