projects
/
mono.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Merge pull request #2785 from alexanderkyte/cached_info_leak
[mono.git]
/
mcs
/
tests
/
dtest-025.cs
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
}