Author: ankit
Date: 2006-01-16 06:36:11 -0500 (Mon, 16 Jan 2006)
New Revision: 55629

Added:
   trunk/mcs/ilasm/tests/test-array-2.il
Modified:
   trunk/mcs/ilasm/codegen/ChangeLog
   trunk/mcs/ilasm/codegen/TypeRef.cs
   trunk/mcs/ilasm/tests/ChangeLog
Log:
In ilasm/tests:

        * test-array-2.il: New. Test for methodref to Array's methods.
        eg. class test [,]::.ctor (int32, int32)

In ilasm/codegen:
        * TypeRef.cs (TypeRef.CreateMethodRef): Return a TypeSpecMethodRef if
        this is a modified (eg. []) type.       


Modified: trunk/mcs/ilasm/codegen/ChangeLog
===================================================================
--- trunk/mcs/ilasm/codegen/ChangeLog   2006-01-16 10:48:43 UTC (rev 55628)
+++ trunk/mcs/ilasm/codegen/ChangeLog   2006-01-16 11:36:11 UTC (rev 55629)
@@ -1,5 +1,10 @@
 2006-01-16  Ankit Jain  <[EMAIL PROTECTED]>
 
+       * TypeRef.cs (TypeRef.CreateMethodRef): Return a TypeSpecMethodRef if
+       this is a modified (eg. []) type.       
+
+2006-01-16  Ankit Jain  <[EMAIL PROTECTED]>
+
        * BaseTypeRef.cs (BaseTypeRef.Resolve): Make this abstract.
        (BaseTypeRef.CreateMethodRef):
        (BaseTypeRef.CreateFieldRef): Make protected and abstract.

Modified: trunk/mcs/ilasm/codegen/TypeRef.cs
===================================================================
--- trunk/mcs/ilasm/codegen/TypeRef.cs  2006-01-16 10:48:43 UTC (rev 55628)
+++ trunk/mcs/ilasm/codegen/TypeRef.cs  2006-01-16 11:36:11 UTC (rev 55629)
@@ -40,7 +40,10 @@
                 protected override BaseMethodRef CreateMethodRef (BaseTypeRef 
ret_type,
                         PEAPI.CallConv call_conv, string name, BaseTypeRef[] 
param, int gen_param_count)
                 {
-                         return new MethodRef (this, call_conv, ret_type, 
name, param, gen_param_count);
+                        if (SigMod == null | SigMod == "")
+                                return new MethodRef (this, call_conv, 
ret_type, name, param, gen_param_count);
+                        else
+                                return new TypeSpecMethodRef (this, call_conv, 
ret_type, name, param, gen_param_count);
                 }
 
                 protected override IFieldRef CreateFieldRef (BaseTypeRef 
ret_type, string name)

Modified: trunk/mcs/ilasm/tests/ChangeLog
===================================================================
--- trunk/mcs/ilasm/tests/ChangeLog     2006-01-16 10:48:43 UTC (rev 55628)
+++ trunk/mcs/ilasm/tests/ChangeLog     2006-01-16 11:36:11 UTC (rev 55629)
@@ -1,3 +1,8 @@
+2006-01-16  Ankit Jain  <[EMAIL PROTECTED]>
+
+       * test-array-2.il: New. Test for methodref to Array's methods.
+       eg. class test [,]::.ctor (int32, int32)
+
 2006-01-15  Ankit Jain  <[EMAIL PROTECTED]>
 
        * test-override-1.il:

Added: trunk/mcs/ilasm/tests/test-array-2.il
===================================================================
--- trunk/mcs/ilasm/tests/test-array-2.il       2006-01-16 10:48:43 UTC (rev 
55628)
+++ trunk/mcs/ilasm/tests/test-array-2.il       2006-01-16 11:36:11 UTC (rev 
55629)
@@ -0,0 +1,40 @@
+// Test for methodref for array methods
+// Eg. class test [,]::.ctor (int32, int32)
+
+.assembly extern mscorlib
+{
+  .ver 1:0:5000:0
+.assembly 'test-array'
+{
+  .ver  0:0:0:0
+}
+.module 'test-array.exe'
+
+
+  .class private auto ansi beforefieldinit test
+       extends [mscorlib]System.Object
+  {
+    .method public hidebysig  specialname  rtspecialname 
+           instance default void .ctor ()  cil managed 
+    {
+       .maxstack 8
+       IL_0000:  ldarg.0 
+       IL_0001:  call instance void object::.ctor()
+       IL_0006:  ret 
+    }
+
+    .method public static  hidebysig 
+           default void Main ()  cil managed 
+    {
+       .entrypoint
+       .maxstack 3
+       .locals init (
+               class test[,]   V_0)
+       IL_0000:  ldc.i4.1 
+       IL_0001:  ldc.i4.1 
+       IL_0002:  newobj instance void class test[,]::.ctor(int32, int32)
+       IL_0007:  stloc.0 
+       IL_0008:  ret 
+    }
+
+  }

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

Reply via email to