projects
/
mono.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
do not check order sequence if option /order was not used
[mono.git]
/
mcs
/
tests
/
test-anon-76.cs
1
using System;
2
3
delegate object FactoryDelegate ();
4
5
public class C
6
{
7
FactoryDelegate var;
8
int counter;
9
10
FactoryDelegate this [string s]
11
{
12
set { var = value; }
13
get { return var; }
14
}
15
16
public void X ()
17
{
18
this ["ABC"] = delegate () {
19
++counter;
20
Console.WriteLine ("A");
21
return "Return";
22
};
23
}
24
25
static int Main ()
26
{
27
C o = new C ();
28
o.X ();
29
30
Console.WriteLine ("B");
31
Console.WriteLine (o ["ABC"] ());
32
33
Console.WriteLine (o.counter);
34
if (o.counter != 1)
35
return 1;
36
37
return 0;
38
}
39
}