2007-11-06 Marek Safar <marek.safar@gmail.com>
authorMarek Safar <marek.safar@gmail.com>
Tue, 6 Nov 2007 16:51:24 +0000 (16:51 -0000)
committerMarek Safar <marek.safar@gmail.com>
Tue, 6 Nov 2007 16:51:24 +0000 (16:51 -0000)
  A test for bugs #337712

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

mcs/tests/gtest-349.cs [new file with mode: 0644]

diff --git a/mcs/tests/gtest-349.cs b/mcs/tests/gtest-349.cs
new file mode 100644 (file)
index 0000000..6820085
--- /dev/null
@@ -0,0 +1,28 @@
+using System.Collections;
+using System;
+using System.Reflection;
+
+class X
+{
+       public delegate R Function<T1, T2, R>(T1 arg1, T2 arg2);
+
+       static int Main ()
+       {
+               Delegate [] e = new Delegate [] {
+                       new Function<IList,IList,int> (f2),
+                       new Function<IList,object,int> (f2)
+               };
+               
+               if ((int)e [0].DynamicInvoke (null, null) != 1)
+                       return 1;
+
+               if ((int) e [1].DynamicInvoke (null, null) != 2)
+                       return 2;
+
+               Console.WriteLine ("OK");
+               return 0;
+       }
+
+       static int f2 (IList self, IList other) { return 1; }
+       static int f2 (IList self, object other) {return 2; }
+}
\ No newline at end of file