Author: kumpera
Date: 2007-10-09 08:49:55 -0400 (Tue, 09 Oct 2007)
New Revision: 87160

Modified:
   trunk/mcs/ilasm/codegen/ChangeLog
   trunk/mcs/ilasm/codegen/MethodPointerTypeRef.cs
Log:
2007-10-09  Rodrigo Kumpera  <[EMAIL PROTECTED]>

        * MethodPointerTypeRef.cs (.ctor): generate
        full name of the method pointer. This is required
        to alow overloading with method pointers.



Modified: trunk/mcs/ilasm/codegen/ChangeLog
===================================================================
--- trunk/mcs/ilasm/codegen/ChangeLog   2007-10-09 12:45:39 UTC (rev 87159)
+++ trunk/mcs/ilasm/codegen/ChangeLog   2007-10-09 12:49:55 UTC (rev 87160)
@@ -1,3 +1,9 @@
+2007-10-09  Rodrigo Kumpera  <[EMAIL PROTECTED]>
+
+       * MethodPointerTypeRef.cs (.ctor): generate
+       full name of the method pointer. This is required
+       to alow overloading with method pointers.
+
 2007-07-18  Jb Evain  <[EMAIL PROTECTED]>
 
        * InstrTable.cs: add brzero alias.

Modified: trunk/mcs/ilasm/codegen/MethodPointerTypeRef.cs
===================================================================
--- trunk/mcs/ilasm/codegen/MethodPointerTypeRef.cs     2007-10-09 12:45:39 UTC 
(rev 87159)
+++ trunk/mcs/ilasm/codegen/MethodPointerTypeRef.cs     2007-10-09 12:49:55 UTC 
(rev 87160)
@@ -9,6 +9,7 @@
 
 
 using System;
+using System.Text;
 using System.Collections;
 
 namespace Mono.ILASM {
@@ -32,10 +33,33 @@
                         this.param_list = param_list;
 
                         // We just need these to not break the interface
-                        //full_name = String.Empty;
+                        full_name = BuildTypeName ();
                         //sig_mod = String.Empty;
                 }
 
+                private String BuildTypeName ()
+                {
+                        StringBuilder builder = new StringBuilder ();
+                        builder.Append ("method ");
+                        if (callconv != PEAPI.CallConv.Default) {
+                                builder.Append (callconv.ToString ());
+                                builder.Append (' ');
+                        }
+                        builder.Append (ret.FullName);
+                        builder.Append ("*(");
+                        if (param_list != null) {
+                                bool first = true;
+                                foreach (ParamDef paramdef in param_list) {
+                                        if (!first)
+                                                builder.Append (',');
+                                        builder.Append (paramdef.TypeName);
+                                        first = false;
+                                }
+                        }
+                        builder.Append (')');
+                        return builder.ToString ();
+                }
+
                 public override BaseTypeRef Clone ()
                 {
                         return new MethodPointerTypeRef (callconv, ret, 
(ArrayList) param_list.Clone (),

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

Reply via email to