2005-10-04 Martin Baulig <martin@ximian.com>
authorMartin Baulig <martin@novell.com>
Tue, 4 Oct 2005 10:49:40 +0000 (10:49 -0000)
committerMartin Baulig <martin@novell.com>
Tue, 4 Oct 2005 10:49:40 +0000 (10:49 -0000)
* expression.cs (DelegateInvocation.EmitStatement): Make this work
for corlib.  Fixes #75691.

svn path=/trunk/mcs/; revision=51162

mcs/gmcs/ChangeLog
mcs/gmcs/delegate.cs
mcs/tests/gtest-207.cs [new file with mode: 0644]

index 38fbae930cd6aadcb6bd93b4bfa0bdf1f57e59a0..2e7a21c681a13b3818ac32bc0245423ca5e7d7f6 100644 (file)
@@ -1,3 +1,8 @@
+2005-10-04  Martin Baulig  <martin@ximian.com>
+
+       * expression.cs (DelegateInvocation.EmitStatement): Make this work
+       for corlib.  Fixes #75691.
+
 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
 
        Fix #76255.
index 57999dc8dd705fa127ef11a20c2ee907874c906f..aafc593ea34c368ff7730281fe77f4c9a4b0897a 100644 (file)
@@ -1052,7 +1052,8 @@ namespace Mono.CSharp {
                        // Pop the return value if there is one
                        //
                        if (method is MethodInfo){
-                               if (((MethodInfo) method).ReturnType != TypeManager.void_type)
+                               Type ret = ((MethodInfo)method).ReturnType;
+                               if (TypeManager.TypeToCoreType (ret) != TypeManager.void_type)
                                        ec.ig.Emit (OpCodes.Pop);
                        }
                }
diff --git a/mcs/tests/gtest-207.cs b/mcs/tests/gtest-207.cs
new file mode 100644 (file)
index 0000000..84128e5
--- /dev/null
@@ -0,0 +1,10 @@
+class M {
+  static void p (string x) {
+    System.Console.WriteLine (x);
+  }
+
+  static void Main () {
+    string[] arr = new string[] { "a", "b", "c" };
+    System.Array.ForEach (arr, p);
+  }
+}