blob: 8d25d7fdca5a7eb6a4f923bfd4c80834dc5e7213 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
using System.Collections;
using System;
using System.Reflection;
class X
{
public delegate R Function<T1, T2, R>(T1 arg1, T2 arg2);
public 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; }
}
|