Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Safar <marek.safar@gmail.com>2007-02-10 02:01:56 +0300
committerMarek Safar <marek.safar@gmail.com>2007-02-10 02:01:56 +0300
commit8b2bcc5736bddd89b24921a6e95342ad33433ed9 (patch)
tree26e7f8873ff811a56e974976553983ada6e2ab05 /mcs/tests/test-560.cs
parent8ea5b271ac3ddbccb6c393cdce9510ccf21dae97 (diff)
Test based on #80315
svn path=/trunk/mcs/; revision=72562
Diffstat (limited to 'mcs/tests/test-560.cs')
-rw-r--r--mcs/tests/test-560.cs52
1 files changed, 52 insertions, 0 deletions
diff --git a/mcs/tests/test-560.cs b/mcs/tests/test-560.cs
new file mode 100644
index 00000000000..1dfb911e7d6
--- /dev/null
+++ b/mcs/tests/test-560.cs
@@ -0,0 +1,52 @@
+using System;
+
+namespace Bugs
+{
+ class Bug2
+ {
+ struct MyByte
+ {
+ private byte value;
+ public MyByte(byte value)
+ {
+ this.value = value;
+ }
+ public static implicit operator MyByte(byte value)
+ {
+ return new MyByte(value);
+ }
+ public static implicit operator byte(MyByte b)
+ {
+ return b.value;
+ }
+ }
+
+ struct MyInt
+ {
+ private int value;
+ public MyInt(int value)
+ {
+ this.value = value;
+ }
+ public static implicit operator MyInt(int value)
+ {
+ return new MyInt(value);
+ }
+ public static implicit operator int(MyInt b)
+ {
+ return b.value;
+ }
+ }
+
+ public static void Main(string[] args)
+ {
+ MyByte b = 255;
+ b += 255;
+ Console.WriteLine(b);
+
+ MyInt i = 3;
+ i &= (4 + i);
+ Console.WriteLine(i);
+ }
+ }
+}