blob: 6dc033e1fb9a9b47adda509e0ddcb5800b85c61d (
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
29
30
31
32
33
34
35
36
37
38
|
using System;
delegate void Test (int test);
class X
{
static int result = 0;
public static void hello (int arg)
{
result += arg;
}
public static void world (int arg)
{
result += 16 * arg;
}
public static int Main ()
{
Test a = new Test (hello);
Test b = new Test (world);
(a + b) (1);
if (result != 17)
return 1;
((result == 17) ? a : b) (2);
if (result != 19)
return 2;
((result == 17) ? a : b) (2);
if (result != 51)
return 3;
return 0;
}
}
|