diff --git a/csharp/src/Google.Protobuf/Reflection/ExtensionCollection.cs b/csharp/src/Google.Protobuf/Reflection/ExtensionCollection.cs index 9cb6abaf9a..38a97fc4b0 100644 --- a/csharp/src/Google.Protobuf/Reflection/ExtensionCollection.cs +++ b/csharp/src/Google.Protobuf/Reflection/ExtensionCollection.cs @@ -39,7 +39,7 @@ namespace Google.Protobuf.Reflection /// /// A collection to simplify retrieving the descriptors of extensions in a descriptor for a message /// - public class ExtensionCollection + public sealed class ExtensionCollection { private IDictionary> extensionsByTypeInDeclarationOrder; private IDictionary> extensionsByTypeInNumberOrder; diff --git a/csharp/src/Google.Protobuf/Reflection/FieldDescriptor.cs b/csharp/src/Google.Protobuf/Reflection/FieldDescriptor.cs index c06328f99c..482b3f823a 100644 --- a/csharp/src/Google.Protobuf/Reflection/FieldDescriptor.cs +++ b/csharp/src/Google.Protobuf/Reflection/FieldDescriptor.cs @@ -203,6 +203,11 @@ namespace Google.Protobuf.Reflection /// public bool IsPacked => File.Proto.Syntax == "proto2" ? Proto.Options?.Packed ?? false : !Proto.Options.HasPacked || Proto.Options.Packed; + /// + /// Returns true if this field extends another message type; false otherwise. + /// + public bool IsExtension => Proto.HasExtendee; + /// /// Returns the type of the field. ///