Author: benm
Date: 2005-07-03 23:12:39 -0400 (Sun, 03 Jul 2005)
New Revision: 46898

Modified:
   trunk/mcs/tools/monop/ChangeLog
   trunk/mcs/tools/monop/outline.cs
Log:
        * outline.cs: Support for methods with generic parameters.



Modified: trunk/mcs/tools/monop/ChangeLog
===================================================================
--- trunk/mcs/tools/monop/ChangeLog     2005-07-03 23:24:14 UTC (rev 46897)
+++ trunk/mcs/tools/monop/ChangeLog     2005-07-04 03:12:39 UTC (rev 46898)
@@ -1,5 +1,7 @@
 2005-07-03  Ben Maurer  <[EMAIL PROTECTED]>
 
+       * outline.cs: Support for methods with generic parameters.
+
        * *: begin support for 2.0
 
        * outline.cs: Add support for readonly fields.

Modified: trunk/mcs/tools/monop/outline.cs
===================================================================
--- trunk/mcs/tools/monop/outline.cs    2005-07-03 23:24:14 UTC (rev 46897)
+++ trunk/mcs/tools/monop/outline.cs    2005-07-04 03:12:39 UTC (rev 46898)
@@ -359,6 +359,9 @@
                o.Write (FormatType (mi.ReturnType));
                o.Write (" ");
                o.Write (mi.Name);
+#if NET_2_0
+               o.Write (FormatGenericParams (mi.GetGenericArguments ()));
+#endif
                o.Write (" (");
                OutlineParams (mi.GetParameters ());
                o.Write (");");
@@ -485,6 +488,22 @@
                         return "internal";
                 }
        }
+
+       string FormatGenericParams (Type [] args)
+       {
+               StringBuilder sb = new StringBuilder ();
+               if (args.Length == 0)
+                       return "";
+               
+               sb.Append ("<");
+               for (int i = 0; i < args.Length; i++) {
+                       if (i > 0)
+                               sb.Append (",");
+                       sb.Append (FormatType (args [i]));
+               }
+               sb.Append (">");
+               return sb.ToString ();
+       }
        
        string FormatType (Type t)
        {
@@ -568,16 +587,7 @@
        {
                sb.Append (RemoveGenericArity (t.Name));
 #if NET_2_0
-               Type[] args = t.GetGenericArguments ();
-               if (args.Length > 0) {
-                       sb.Append ("<");
-                       for (int i = 0; i < args.Length; i++) {
-                               if (i > 0)
-                                       sb.Append (",");
-                               sb.Append (FormatType (args [i]));
-                       }
-                       sb.Append (">");
-               }
+               sb.Append (FormatGenericParams (t.GetGenericArguments ()));
 #endif
        }
 

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to