diff options
author | Jon Skeet <skeet@pobox.com> | 2008-08-14 20:35:27 +0100 |
---|---|---|
committer | Jon Skeet <skeet@pobox.com> | 2008-08-14 20:35:27 +0100 |
commit | f26f8dce0279b3cd0ee9708bfca322be5c19d4f7 (patch) | |
tree | d5165af45b3bcc0243518ad766eb358f04a0980e /csharp/ProtocolBuffers/GeneratedSingleExtension.cs | |
parent | 9134a21f27728996237010449fe9273b3bf4be78 (diff) | |
download | protobuf-f26f8dce0279b3cd0ee9708bfca322be5c19d4f7.tar.gz protobuf-f26f8dce0279b3cd0ee9708bfca322be5c19d4f7.tar.bz2 protobuf-f26f8dce0279b3cd0ee9708bfca322be5c19d4f7.zip |
The great generics revisiting.
Diffstat (limited to 'csharp/ProtocolBuffers/GeneratedSingleExtension.cs')
-rw-r--r-- | csharp/ProtocolBuffers/GeneratedSingleExtension.cs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/csharp/ProtocolBuffers/GeneratedSingleExtension.cs b/csharp/ProtocolBuffers/GeneratedSingleExtension.cs index 0adcd7ef..d9a0adcf 100644 --- a/csharp/ProtocolBuffers/GeneratedSingleExtension.cs +++ b/csharp/ProtocolBuffers/GeneratedSingleExtension.cs @@ -6,17 +6,15 @@ namespace Google.ProtocolBuffers { /// <summary> /// Generated extension for a singular field. /// </remarks> - public class GeneratedSingleExtension<TContainer, TExtension> : GeneratedExtensionBase<TContainer, TExtension> - where TContainer : IMessage<TContainer> { - + public class GeneratedSingleExtension<TExtension> : GeneratedExtensionBase<TExtension> { internal GeneratedSingleExtension(FieldDescriptor descriptor) : base(descriptor, typeof(TExtension)) { } - public static GeneratedSingleExtension<TContainer, TExtension> CreateInstance(FieldDescriptor descriptor) { + public static GeneratedSingleExtension<TExtension> CreateInstance(FieldDescriptor descriptor) { if (descriptor.IsRepeated) { throw new ArgumentException("Must call GeneratedRepeateExtension.CreateInstance() for repeated types."); } - return new GeneratedSingleExtension<TContainer, TExtension>(descriptor); + return new GeneratedSingleExtension<TExtension>(descriptor); } public override object FromReflectionType(object value) { |