repo.or.cz
/
mcs.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
* ResolvedReference.cs (.ctor): Set 'OriginalItemSpec' and 'ResolvedFrom',
[mcs.git]
/
tests
/
test-anon-76.cs
blob
ee50eba347f8a842cc2635ecc11e9bd2b7cbcf34
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
}