Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.10.x - Remove internal constraint on descriptor proto (C#) #6799

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
50 changes: 25 additions & 25 deletions csharp/src/Google.Protobuf/Reflection/Descriptor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
namespace Google.Protobuf.Reflection {

/// <summary>Holder for reflection information generated from google/protobuf/descriptor.proto</summary>
internal static partial class DescriptorReflection {
public static partial class DescriptorReflection {

#region Descriptor
/// <summary>File descriptor for google/protobuf/descriptor.proto</summary>
Expand Down Expand Up @@ -193,7 +193,7 @@ internal static partial class DescriptorReflection {
/// The protocol compiler can output a FileDescriptorSet containing the .proto
/// files it parses.
/// </summary>
internal sealed partial class FileDescriptorSet : pb::IMessage<FileDescriptorSet> {
public sealed partial class FileDescriptorSet : pb::IMessage<FileDescriptorSet> {
private static readonly pb::MessageParser<FileDescriptorSet> _parser = new pb::MessageParser<FileDescriptorSet>(() => new FileDescriptorSet());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Expand Down Expand Up @@ -317,7 +317,7 @@ internal sealed partial class FileDescriptorSet : pb::IMessage<FileDescriptorSet
/// <summary>
/// Describes a complete .proto file.
/// </summary>
internal sealed partial class FileDescriptorProto : pb::IMessage<FileDescriptorProto> {
public sealed partial class FileDescriptorProto : pb::IMessage<FileDescriptorProto> {
private static readonly pb::MessageParser<FileDescriptorProto> _parser = new pb::MessageParser<FileDescriptorProto>(() => new FileDescriptorProto());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Expand Down Expand Up @@ -800,7 +800,7 @@ internal sealed partial class FileDescriptorProto : pb::IMessage<FileDescriptorP
/// <summary>
/// Describes a message type.
/// </summary>
internal sealed partial class DescriptorProto : pb::IMessage<DescriptorProto> {
public sealed partial class DescriptorProto : pb::IMessage<DescriptorProto> {
private static readonly pb::MessageParser<DescriptorProto> _parser = new pb::MessageParser<DescriptorProto>(() => new DescriptorProto());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Expand Down Expand Up @@ -1151,7 +1151,7 @@ internal sealed partial class DescriptorProto : pb::IMessage<DescriptorProto> {
/// <summary>Container for nested types declared in the DescriptorProto message type.</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static partial class Types {
internal sealed partial class ExtensionRange : pb::IMessage<ExtensionRange> {
public sealed partial class ExtensionRange : pb::IMessage<ExtensionRange> {
private static readonly pb::MessageParser<ExtensionRange> _parser = new pb::MessageParser<ExtensionRange>(() => new ExtensionRange());
private pb::UnknownFieldSet _unknownFields;
private int _hasBits0;
Expand Down Expand Up @@ -1391,7 +1391,7 @@ internal sealed partial class ExtensionRange : pb::IMessage<ExtensionRange> {
/// fields or extension ranges in the same message. Reserved ranges may
/// not overlap.
/// </summary>
internal sealed partial class ReservedRange : pb::IMessage<ReservedRange> {
public sealed partial class ReservedRange : pb::IMessage<ReservedRange> {
private static readonly pb::MessageParser<ReservedRange> _parser = new pb::MessageParser<ReservedRange>(() => new ReservedRange());
private pb::UnknownFieldSet _unknownFields;
private int _hasBits0;
Expand Down Expand Up @@ -1714,7 +1714,7 @@ internal sealed partial class ExtensionRangeOptions : pb::IMessage<ExtensionRang
/// <summary>
/// Describes a field within a message.
/// </summary>
internal sealed partial class FieldDescriptorProto : pb::IMessage<FieldDescriptorProto> {
public sealed partial class FieldDescriptorProto : pb::IMessage<FieldDescriptorProto> {
private static readonly pb::MessageParser<FieldDescriptorProto> _parser = new pb::MessageParser<FieldDescriptorProto>(() => new FieldDescriptorProto());
private pb::UnknownFieldSet _unknownFields;
private int _hasBits0;
Expand Down Expand Up @@ -2259,7 +2259,7 @@ internal sealed partial class FieldDescriptorProto : pb::IMessage<FieldDescripto
/// <summary>Container for nested types declared in the FieldDescriptorProto message type.</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static partial class Types {
internal enum Type {
public enum Type {
/// <summary>
/// 0 is reserved for errors.
/// Order is weird for historical reasons.
Expand Down Expand Up @@ -2310,7 +2310,7 @@ internal enum Type {
[pbr::OriginalName("TYPE_SINT64")] Sint64 = 18,
}

internal enum Label {
public enum Label {
/// <summary>
/// 0 is reserved for errors
/// </summary>
Expand All @@ -2327,7 +2327,7 @@ internal enum Label {
/// <summary>
/// Describes a oneof.
/// </summary>
internal sealed partial class OneofDescriptorProto : pb::IMessage<OneofDescriptorProto> {
public sealed partial class OneofDescriptorProto : pb::IMessage<OneofDescriptorProto> {
private static readonly pb::MessageParser<OneofDescriptorProto> _parser = new pb::MessageParser<OneofDescriptorProto>(() => new OneofDescriptorProto());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Expand Down Expand Up @@ -2515,7 +2515,7 @@ internal sealed partial class OneofDescriptorProto : pb::IMessage<OneofDescripto
/// <summary>
/// Describes an enum type.
/// </summary>
internal sealed partial class EnumDescriptorProto : pb::IMessage<EnumDescriptorProto> {
public sealed partial class EnumDescriptorProto : pb::IMessage<EnumDescriptorProto> {
private static readonly pb::MessageParser<EnumDescriptorProto> _parser = new pb::MessageParser<EnumDescriptorProto>(() => new EnumDescriptorProto());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Expand Down Expand Up @@ -2779,7 +2779,7 @@ public static partial class Types {
/// is inclusive such that it can appropriately represent the entire int32
/// domain.
/// </summary>
internal sealed partial class EnumReservedRange : pb::IMessage<EnumReservedRange> {
public sealed partial class EnumReservedRange : pb::IMessage<EnumReservedRange> {
private static readonly pb::MessageParser<EnumReservedRange> _parser = new pb::MessageParser<EnumReservedRange>(() => new EnumReservedRange());
private pb::UnknownFieldSet _unknownFields;
private int _hasBits0;
Expand Down Expand Up @@ -2978,7 +2978,7 @@ internal sealed partial class EnumReservedRange : pb::IMessage<EnumReservedRange
/// <summary>
/// Describes a value within an enum.
/// </summary>
internal sealed partial class EnumValueDescriptorProto : pb::IMessage<EnumValueDescriptorProto> {
public sealed partial class EnumValueDescriptorProto : pb::IMessage<EnumValueDescriptorProto> {
private static readonly pb::MessageParser<EnumValueDescriptorProto> _parser = new pb::MessageParser<EnumValueDescriptorProto>(() => new EnumValueDescriptorProto());
private pb::UnknownFieldSet _unknownFields;
private int _hasBits0;
Expand Down Expand Up @@ -3209,7 +3209,7 @@ internal sealed partial class EnumValueDescriptorProto : pb::IMessage<EnumValueD
/// <summary>
/// Describes a service.
/// </summary>
internal sealed partial class ServiceDescriptorProto : pb::IMessage<ServiceDescriptorProto> {
public sealed partial class ServiceDescriptorProto : pb::IMessage<ServiceDescriptorProto> {
private static readonly pb::MessageParser<ServiceDescriptorProto> _parser = new pb::MessageParser<ServiceDescriptorProto>(() => new ServiceDescriptorProto());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Expand Down Expand Up @@ -3417,7 +3417,7 @@ internal sealed partial class ServiceDescriptorProto : pb::IMessage<ServiceDescr
/// <summary>
/// Describes a method of a service.
/// </summary>
internal sealed partial class MethodDescriptorProto : pb::IMessage<MethodDescriptorProto> {
public sealed partial class MethodDescriptorProto : pb::IMessage<MethodDescriptorProto> {
private static readonly pb::MessageParser<MethodDescriptorProto> _parser = new pb::MessageParser<MethodDescriptorProto>(() => new MethodDescriptorProto());
private pb::UnknownFieldSet _unknownFields;
private int _hasBits0;
Expand Down Expand Up @@ -4816,7 +4816,7 @@ public static partial class Types {
/// <summary>
/// Generated classes can be optimized for speed or code size.
/// </summary>
internal enum OptimizeMode {
public enum OptimizeMode {
/// <summary>
/// Generate complete code for parsing, serialization,
/// </summary>
Expand Down Expand Up @@ -5622,7 +5622,7 @@ internal sealed partial class FieldOptions : pb::IMessage<FieldOptions> {
/// <summary>Container for nested types declared in the FieldOptions message type.</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static partial class Types {
internal enum CType {
public enum CType {
/// <summary>
/// Default mode.
/// </summary>
Expand All @@ -5631,7 +5631,7 @@ internal enum CType {
[pbr::OriginalName("STRING_PIECE")] StringPiece = 2,
}

internal enum JSType {
public enum JSType {
/// <summary>
/// Use the default type.
/// </summary>
Expand Down Expand Up @@ -6570,7 +6570,7 @@ public static partial class Types {
/// or neither? HTTP based RPC implementation may choose GET verb for safe
/// methods, and PUT verb for idempotent methods instead of the default POST.
/// </summary>
internal enum IdempotencyLevel {
public enum IdempotencyLevel {
[pbr::OriginalName("IDEMPOTENCY_UNKNOWN")] IdempotencyUnknown = 0,
/// <summary>
/// implies idempotent
Expand All @@ -6595,7 +6595,7 @@ internal enum IdempotencyLevel {
/// or produced by Descriptor::CopyTo()) will never have UninterpretedOptions
/// in them.
/// </summary>
internal sealed partial class UninterpretedOption : pb::IMessage<UninterpretedOption> {
public sealed partial class UninterpretedOption : pb::IMessage<UninterpretedOption> {
private static readonly pb::MessageParser<UninterpretedOption> _parser = new pb::MessageParser<UninterpretedOption>(() => new UninterpretedOption());
private pb::UnknownFieldSet _unknownFields;
private int _hasBits0;
Expand Down Expand Up @@ -6974,7 +6974,7 @@ public static partial class Types {
/// E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents
/// "foo.(bar.baz).qux".
/// </summary>
internal sealed partial class NamePart : pb::IMessage<NamePart> {
public sealed partial class NamePart : pb::IMessage<NamePart> {
private static readonly pb::MessageParser<NamePart> _parser = new pb::MessageParser<NamePart>(() => new NamePart());
private pb::UnknownFieldSet _unknownFields;
private int _hasBits0;
Expand Down Expand Up @@ -7167,7 +7167,7 @@ internal sealed partial class NamePart : pb::IMessage<NamePart> {
/// Encapsulates information about the original source file from which a
/// FileDescriptorProto was generated.
/// </summary>
internal sealed partial class SourceCodeInfo : pb::IMessage<SourceCodeInfo> {
public sealed partial class SourceCodeInfo : pb::IMessage<SourceCodeInfo> {
private static readonly pb::MessageParser<SourceCodeInfo> _parser = new pb::MessageParser<SourceCodeInfo>(() => new SourceCodeInfo());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Expand Down Expand Up @@ -7335,7 +7335,7 @@ internal sealed partial class SourceCodeInfo : pb::IMessage<SourceCodeInfo> {
/// <summary>Container for nested types declared in the SourceCodeInfo message type.</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static partial class Types {
internal sealed partial class Location : pb::IMessage<Location> {
public sealed partial class Location : pb::IMessage<Location> {
private static readonly pb::MessageParser<Location> _parser = new pb::MessageParser<Location>(() => new Location());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Expand Down Expand Up @@ -7669,7 +7669,7 @@ internal sealed partial class Location : pb::IMessage<Location> {
/// file. A GeneratedCodeInfo message is associated with only one generated
/// source file, but may contain references to different source .proto files.
/// </summary>
internal sealed partial class GeneratedCodeInfo : pb::IMessage<GeneratedCodeInfo> {
public sealed partial class GeneratedCodeInfo : pb::IMessage<GeneratedCodeInfo> {
private static readonly pb::MessageParser<GeneratedCodeInfo> _parser = new pb::MessageParser<GeneratedCodeInfo>(() => new GeneratedCodeInfo());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Expand Down Expand Up @@ -7796,7 +7796,7 @@ internal sealed partial class GeneratedCodeInfo : pb::IMessage<GeneratedCodeInfo
/// <summary>Container for nested types declared in the GeneratedCodeInfo message type.</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static partial class Types {
internal sealed partial class Annotation : pb::IMessage<Annotation> {
public sealed partial class Annotation : pb::IMessage<Annotation> {
private static readonly pb::MessageParser<Annotation> _parser = new pb::MessageParser<Annotation>(() => new Annotation());
private pb::UnknownFieldSet _unknownFields;
private int _hasBits0;
Expand Down
6 changes: 0 additions & 6 deletions src/google/protobuf/compiler/csharp/csharp_generator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,6 @@ bool Generator::Generate(
std::vector<std::pair<string, string> > options;
ParseGeneratorParameter(parameter, &options);

// We only support proto3 - but we make an exception for descriptor.proto.
if (file->syntax() != FileDescriptor::SYNTAX_PROTO3 && !IsDescriptorProto(file)) {
*error = "C# code generation only supports proto3 syntax";
return false;
}

struct Options cli_options;

for (int i = 0; i < options.size(); i++) {
Expand Down