2009-03-11 Zoltan Varga <vargaz@gmail.com>
[mcs.git] / tests / test-261.cs
blob014f2e05f07e4f71e4cd20819815c1fa02e35308
1 using System;
3 class T {
4 T Me { get { calls ++; return this; } }
5 T GetMe () { foo ++; return this; }
6 int blah = 0, calls = 0, foo = 0, bar = 0;
8 static int Test (T t)
10 t.Me.Me.blah ++;
11 t.GetMe ().GetMe ().bar++;
12 if (t.blah != 1)
13 return 1;
14 if (t.bar != 1)
15 return 2;
16 if (t.calls != 2)
17 return 3;
18 if (t.foo != 2)
19 return 4;
20 return 0;
23 static int Main ()
25 T t = new T ();
26 int result = Test (t);
27 Console.WriteLine ("RESULT: {0}", result);
28 return result;