projects
/
mono.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
* mb-parser.jay:
[mono.git]
/
mcs
/
tests
/
2test-a6.cs
1
//
2
// Tests capturing of double nested variables
3
//
4
delegate void S ();
5
using System;
6
7
class X {
8
static int Main ()
9
{
10
int i;
11
S b = null;
12
13
for (i = 0; i < 10; i++){
14
int j = 0;
15
b = delegate {
16
Console.WriteLine ("i={0} j={1}", i, j);
17
i = i + 1;
18
j = j + 1;
19
};
20
}
21
b ();
22
Console.WriteLine ("i = {0}", i);
23
if (!t (i, 11))
24
return 1;
25
b ();
26
if (!t (i, 12))
27
return 2;
28
Console.WriteLine ("i = {0}", i);
29
return 0;
30
}
31
32
static bool t (int a, int b)
33
{
34
return a == b;
35
}
36
}