Merge pull request #778 from cmorris98/master
[mono.git] / mcs / tests / test-871.cs
1 using System;
2
3 class D
4 {
5         int arg;
6
7         public D (int arg)
8         {
9                 this.arg = arg;
10         }
11
12         public static D operator & (D x, D y)
13         {
14                 return new D (100);
15         }
16
17         public static bool operator false (D d)
18         {
19                 return false;
20         }
21
22         public static bool operator true (D d)
23         {
24                 return true;
25         }
26
27         public static implicit operator D(bool b)
28         {
29                 return new D (5);
30         }
31
32         static int Main ()
33         {
34                 D d = false && new D (1);
35                 Console.WriteLine (d.arg);
36                 if (d.arg != 100)
37                         return 1;
38
39                 Console.WriteLine ("ok");
40                 return 0;
41         }
42 }