Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mcs / tests / test-560.cs
1 using System;
2
3 namespace Bugs
4 {
5     class Bug2
6     {
7         struct MyByte
8         {
9             private byte value;
10             public MyByte(byte value)
11             {
12                 this.value = value;
13             }
14             public static implicit operator MyByte(byte value)
15             {
16                 return new MyByte(value);
17             }
18             public static implicit operator byte(MyByte b)
19             {
20                 return b.value;
21             }
22         }
23         
24         struct MyInt
25         {
26             private int value;
27             public MyInt(int value)
28             {
29                 this.value = value;
30             }
31             public static implicit operator MyInt(int value)
32             {
33                 return new MyInt(value);
34             }
35             public static implicit operator int(MyInt b)
36             {
37                 return b.value;
38             }
39         }
40
41         public static void Main(string[] args)
42         {
43             MyByte b = 255;
44             b += 255;
45             Console.WriteLine(b);
46             
47             MyInt i = 3;
48             i &= (4 + i);
49             Console.WriteLine(i);
50         }
51     }
52 }