2010-05-25 Jb Evain <jbevain@novell.com>
[mcs.git] / tests / gtest-initialize-10.cs
blob3cf41c54996bf16e6e4cd48d3f9087b5f5fcca6b
1 using System;
3 class Foo
5 public int P { get; set; }
8 class Y
10 static int Main ()
12 Foo foo = new Foo ();
13 foo.P = 1;
15 if (!Do (foo))
16 return 1;
18 Console.WriteLine ("OK");
19 return 0;
22 static bool Do (Foo f)
24 f = new Foo () {
25 P = f.P
28 if (f.P != 1)
29 return false;
31 Foo f2 = new Foo ();
32 f2.P = 9;
33 f2 = new Foo () {
34 P = f2.P
37 if (f2.P != 9)
38 return false;
40 return true;