blob: 062f335c83791a1dfd3800e045ee029fa367592e (
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
// Compiler options: -r:test-anon-94-lib.dll
using System;
class Program
{
public class BaseClass
{
public int i;
public virtual void Print () { Console.WriteLine ("BaseClass.Print"); i = 90; }
public virtual void TestOut (out int arg) { arg = 4; }
}
public class Derived : BaseClass
{
public override void Print ()
{
Action a = () => base.Print ();
a ();
}
public override void TestOut (out int arg)
{
int p = 9;
Action a = () => {
base.TestOut (out p);
Console.WriteLine (p);
};
a ();
arg = p;
}
}
public class DerivedLibrary : BaseClassLibrary
{
public override void Print (int arg)
{
Action a = () => base.Print (30);
a ();
}
}
public static int Main ()
{
var d = new Derived ();
d.Print ();
if (d.i != 90)
return 1;
int arg;
d.TestOut (out arg);
if (arg != 4)
return 2;
var d2 = new DerivedLibrary ();
d2.Print (0);
if (d2.i != 30)
return 3;
return 0;
}
}
|