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] Add reflection dependency tracking
[mono-project.git]
/
mcs
/
tests
/
dtest-025.cs
blob
c741ea76da6853b878f0277f03d8c76e5ced366f
1
interface
I
2
{
3
void
SetValue
(
int
arg
);
4
}
5
6
public struct
S
:
I
7
{
8
public int
Value
;
9
10
public void
SetValue
(
int
v
)
11
{
12
Value
=
v
;
13
}
14
}
15
16
class
C
17
{
18
static void
Method
<
T
> (
ref
T t
)
where T
:
struct
,
I
19
{
20
dynamic
d
=
25
;
21
t
.
SetValue
(
d
);
22
}
23
24
public static int
Main
()
25
{
26
int
?
x
=
null
;
27
dynamic
y
=
50
;
28
int
v
=
x
.
GetValueOrDefault
(
y
);
29
if
(
v
!=
50
)
30
return
1
;
31
32
var
s
=
new
S
();
33
dynamic
d
=
5
;
34
35
s
.
SetValue
(
d
);
36
if
(
s
.
Value
!=
5
)
37
return
2
;
38
39
Method
(
ref
s
);
40
if
(
s
.
Value
!=
25
)
41
return
3
;
42
43
return
0
;
44
}
45
}