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
[tuner] handle the case with multiple "preserve" attributes
[mono-project.git]
/
mcs
/
tests
/
test-anon-06.cs
blob
5f238c734147d015685bb0b1df5bb8c9fe6751d5
1
//
2
// Tests capturing of variables
3
//
4
using
System
;
5
6
delegate void
S
();
7
8
class
X
{
9
public static int
Main
()
10
{
11
int
a
=
1
;
12
if
(
a
!=
1
)
13
return
1
;
14
15
Console
.
WriteLine
(
"A is = "
+
a
);
16
S b
=
delegate
{
17
Console
.
WriteLine
(
"on delegate"
);
18
a
=
2
;
19
};
20
if
(
a
!=
1
)
21
return
2
;
22
b
();
23
if
(
a
!=
2
)
24
return
3
;
25
Console
.
WriteLine
(
"OK"
);
26
return
0
;
27
}
28
}
29