[tuner] handle the case with multiple "preserve" attributes
[mono-project.git] / mcs / tests / test-var-02.cs
blobd64527b69329b479e82f2e4cfec20b40ea75c0a1
2 // Tests variable type inference with the var keyword when assigning to user-defined types
3 using System;
5 public class Class1
7 public bool Method()
9 return true;
11 public int Property = 16;
14 public class Test
16 private class Class2
18 public bool Method()
20 return true;
22 public int Property = 42;
24 public static int Main ()
26 var class1 = new Class1 ();
28 if (class1.GetType () != typeof (Class1))
29 return 1;
30 if (!class1.Method ())
31 return 2;
32 if (class1.Property != 16)
33 return 3;
35 var class2 = new Class2();
37 if (class2.GetType () != typeof (Class2))
38 return 4;
39 if (!class2.Method ())
40 return 5;
41 if (class2.Property != 42)
42 return 6;
44 return 0;