[Mono-devel-list] Little patch for TypeBuilder.DefineGenericParameters

Kamil Skalski nazgul at nemerle.org
Sat Jan 15 15:19:22 EST 2005


Hi! 

According to http://msdn2.microsoft.com/library/9yacbtef.aspx
DefineGenericParameters has signature public GenericTypeParameterBuilder[] 
DefineGenericParameters (string[] names), but in MS.NET 2.0Beta1 it seems to 
have 'params' keyword, because DefineGenericParameters ("a", "b") works. 
The same goes to MethodBuilder.DefineGenericParameters.

Here is the patch to correct it in mono:

Index: class/corlib/System.Reflection.Emit/MethodBuilder.cs
===================================================================
--- class/corlib/System.Reflection.Emit/MethodBuilder.cs        (revision 
38569)
+++ class/corlib/System.Reflection.Emit/MethodBuilder.cs        (working copy)
@@ -376,7 +376,7 @@
                        return result;
                }

-               public GenericTypeParameterBuilder[] DefineGenericParameters 
(string[] names)
+               public GenericTypeParameterBuilder[] DefineGenericParameters 
(params string[] names)
                {
                        generic_params = new GenericTypeParameterBuilder 
[names.Length];
                        for (int i = 0; i < names.Length; i++)
Index: class/corlib/System.Reflection.Emit/TypeBuilder.cs
===================================================================
--- class/corlib/System.Reflection.Emit/TypeBuilder.cs  (revision 38569)
+++ class/corlib/System.Reflection.Emit/TypeBuilder.cs  (working copy)
@@ -1383,7 +1383,7 @@
                        }
                }

-               public GenericTypeParameterBuilder[] DefineGenericParameters 
(string[] names)
+               public GenericTypeParameterBuilder[] DefineGenericParameters 
(params string[] names)
                {
                        setup_generic_class ();




More information about the Mono-devel-list mailing list