blob: a8807033d34fdc36d588085f222145d8afd4d64e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
interface IA
{
}
interface IF : IA
{
int Prop { set; }
}
struct S : IF
{
int prop;
public S (int a)
{
this.prop = 5;
}
public int Prop {
set {
prop = value;
}
}
void M<T> (T ia) where T : struct, IA
{
((IF)ia).Prop = 3;
}
public static void Main ()
{
S s = new S ();
object o = s;
((IF)((S)o)).Prop = 3;
IA ia = new S ();
((IF)ia).Prop = 3;
}
}
|