blob: 4dc7d1cee22b4d30e2ce60cdc613bbc5fed464d9 (
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
|
using System;
interface Iface {
int A ();
}
class Implementor : Iface {
public int A () {
return 1;
}
}
struct StructImplementor : Iface {
public int A () {
return 2;
}
}
class Run {
public static int Main ()
{
Iface iface;
Implementor i = new Implementor ();
iface = i;
if (iface.A () != 1)
return 1;
StructImplementor s = new StructImplementor ();
Iface xiface = (Iface) s;
if (xiface.A () != 2)
return 2;
return 0;
}
}
|