repo.or.cz
/
mono-project.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
* MonthCalendar.cs:
[mono-project.git]
/
mcs
/
tests
/
a-capture6.cs
blob
ecb5c5144581c496c7e7b8ae7ac4db329fb4809d
1
//
2
// Tests capturing of variables
3
//
4
delegate void
S
();
5
using
System
;
6
7
class
X
{
8
static int
Main
()
9
{
10
int
a
=
1
;
11
if
(
a
!=
1
)
12
return
1
;
13
14
Console
.
WriteLine
(
"A is = "
+
a
);
15
S b
=
delegate
{
16
Console
.
WriteLine
(
"on delegate"
);
17
a
=
2
;
18
};
19
if
(
a
!=
1
)
20
return
2
;
21
b
();
22
if
(
a
!=
2
)
23
return
3
;
24
Console
.
WriteLine
(
"OK"
);
25
return
0
;
26
}
27
}
28