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
[System] Tweak socket test
[mono-project.git]
/
mono
/
tests
/
bug-685908.cs
blob
32a9faa6e1fc588f925fb024ea5c89839b5da618
1
2
using
System
;
3
using
System
.
Linq
;
4
using
System
.
Linq
.
Expressions
;
5
6
class
Program
7
{
8
static int
Main
()
9
{
10
if
(
Test
<
S
> () ==
5
)
11
return
0
;
12
return
1
;
13
}
14
15
static int
Test
<
T
> ()
where T
:
I
16
{
17
Expression
<
Func
<
T
,
int
>>
e
=
l
=>
l
.
SetValue
() +
l
.
Value
;
18
var
arg
=
default
(
T
);
19
return
(
int
) (
e
.
Compile
() (
arg
));
20
}
21
}
22
23
interface
I
24
{
25
int
Value { get; }
26
int
SetValue
();
27
}
28
29
struct
S
:
I
30
{
31
int value
;
32
33
public int
Value
{
34
get
{
35
return value
;
36
}
37
}
38
39
public int
SetValue
()
40
{
41
value
=
5
;
42
return
0
;
43
}
44
}