repo.or.cz
/
mono-project
/
dkf.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
EncoderReplacementFallbackBuffer.Reset() did not really reset its internals.
[mono-project/dkf.git]
/
mcs
/
tests
/
test-anon-96.cs
blob
adad3ff938844eeaed5da38f378ad4cb934056e8
1
using
System
;
2
3
class
P
4
{
5
public int
A
;
6
}
7
8
static class
Program
9
{
10
static int
Extra
()
{ return 36; }
11
12
delegate int
D
();
13
14
static
D
Get
(
int
dummy
)
15
{
16
var
p
=
new
P { A = 6 }
;
17
switch
(
dummy
) {
18
case
0
:
19
int
extra
=
Extra
();
20
return
() =>
p
.
A
+
extra
;
21
case
1
:
22
extra
=
9
;
23
return
() =>
p
.
A
*
extra
;
24
case
2
:
25
return
() =>
p
.
A
*
2
;
26
}
27
throw new
NotSupportedException
();
28
}
29
30
static int
Run
(
int
i
)
31
{
32
return
Get
(
i
) ();
33
}
34
35
static int
Main
()
36
{
37
if
(
Run
(
0
) !=
42
)
38
return
1
;
39
40
if
(
Run
(
1
) !=
54
)
41
return
2
;
42
43
if
(
Run
(
2
) !=
12
)
44
return
3
;
45
46
if
(
Run
(
1
) !=
54
)
47
return
4
;
48
49
if
(
Run
(
0
) !=
42
)
50
return
5
;
51
52
return
0
;
53
}
54
}