[corlib] Fix a few NSLogWriter issues. (#13799)
[mono-project.git] / mcs / tests / dtest-039.cs
blob1535710bc3e9e0a28634a0ff175aeb79b7cc438b
1 class A
3 public virtual object Foo ()
5 return null;
8 public virtual object[] FooArray ()
10 return null;
13 internal virtual object Prop {
14 get {
15 return 9;
17 set {
21 public virtual object[] PropArray {
22 get {
23 return null;
27 internal virtual object this [int arg] {
28 get {
29 return 5;
31 set {
36 class B : A
38 public override dynamic Foo ()
40 return 5;
43 public override dynamic[] FooArray ()
45 return new object [] { 'a', 'b' , 'z' };
48 internal override dynamic Prop {
49 set {
53 public override dynamic[] PropArray {
54 get {
55 return new object [] { 'a', 'b' };
59 internal override dynamic this [int arg] {
60 set {
65 class MainClass : B
67 void Test ()
69 char ch;
70 ch = Prop;
71 ch = PropArray [1];
72 ch = this [1];
75 public static int Main ()
77 B b = new B ();
78 int res;
79 res = b.Foo ();
80 if (res != 5)
81 return 1;
83 char ch = b.FooArray () [1];
84 if (ch != 'b')
85 return 2;
87 ++b.Prop;
88 res = b.Prop;
89 if (res != 9)
90 return 3;
92 ch = b.PropArray [1];
93 if (ch != 'b')
94 return 4;
96 res = b [3];
97 if (res != 5)
98 return 5;
100 return 0;