2002-08-11 Martin Baulig <martin@gnome.org>
[mono.git] / mcs / tests / test-162.cs
1 using System;
2
3 struct A
4 {
5         public int a;
6         private long b;
7         private float c;
8
9         public A (int foo)
10         {
11                 a = foo;
12                 b = 8;
13                 c = 9.0F;
14         }
15 }
16
17 struct B
18 {
19         public int a;
20 }
21
22 struct C
23 {
24         public long b;
25
26         public C (long foo)
27         {
28                 b = foo;
29         }
30
31         // has `this' initializer, no need to initialize fields.
32         public C (string foo)
33                 : this (500)
34         { }
35 }
36
37 class X
38 {
39         static void test_output (A x)
40         {
41         }
42
43         static void test_output (B y)
44         {
45         }
46
47         static void test1 ()
48         {
49                 A x;
50
51                 x.a = 5;
52                 Console.WriteLine (x.a);
53         }
54
55         static void test2 ()
56         {
57                 B y;
58
59                 y.a = 5;
60                 Console.WriteLine (y.a);
61                 Console.WriteLine (y);
62         }
63
64         static void test3 ()
65         {
66                 A x = new A (85);
67
68                 Console.WriteLine (x);
69         }
70
71         static void test4 (A x)
72         {
73                 x.a = 5;
74         }
75
76         static void test5 (out A x)
77         {
78                 x = new A (85);
79         }
80
81         static void test6 (out B y)
82         {
83                 y.a = 1;
84         }
85
86         public static int Main ()
87         {
88                 // Compilation-only test.
89                 return 0;
90         }
91 }