projects
/
mono.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Flush tests
[mono.git]
/
mcs
/
tests
/
test-28.cs
1
abstract class A {
2
protected abstract int this [int a] { get; }
3
}
4
5
class B : A {
6
protected override int this [int a] { get { return a;} }
7
8
public int M ()
9
{
10
return this [0];
11
}
12
13
}
14
class X {
15
int v1, v2;
16
17
int this [int a] {
18
get {
19
if (a == 0)
20
return v1;
21
else
22
return v2;
23
}
24
25
set {
26
if (a == 0)
27
v1 = value;
28
else
29
v2 = value;
30
}
31
}
32
33
static int Main ()
34
{
35
X x = new X ();
36
int b;
37
38
x [0] = 1;
39
if (x.v1 != 1)
40
return 1;
41
42
if (x [0] != 1)
43
return 2;
44
45
return new B ().M ();
46
}
47
}