diff options
Diffstat (limited to 'csharp/ProtocolBuffers/GeneratedRepeatException.cs')
-rw-r--r-- | csharp/ProtocolBuffers/GeneratedRepeatException.cs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/csharp/ProtocolBuffers/GeneratedRepeatException.cs b/csharp/ProtocolBuffers/GeneratedRepeatException.cs index d766d7f6..a38f5c1b 100644 --- a/csharp/ProtocolBuffers/GeneratedRepeatException.cs +++ b/csharp/ProtocolBuffers/GeneratedRepeatException.cs @@ -8,11 +8,11 @@ namespace Google.ProtocolBuffers { /// Class used to represent repeat extensions in generated classes. /// </summary> public class GeneratedRepeatExtension<TContainer, TExtensionElement> : GeneratedExtensionBase<TContainer, IList<TExtensionElement>> { - private GeneratedRepeatExtension(FieldDescriptor field) : base(field) { + private GeneratedRepeatExtension(FieldDescriptor field) : base(field, typeof(TExtensionElement)) { } public static GeneratedExtensionBase<TContainer, IList<TExtensionElement>> CreateInstance(FieldDescriptor descriptor) { - if (descriptor.IsRepeated) { + if (!descriptor.IsRepeated) { throw new ArgumentException("Must call GeneratedRepeatExtension.CreateInstance() for repeated types."); } return new GeneratedRepeatExtension<TContainer, TExtensionElement>(descriptor); |