[Mono-bugs] [Bug 80313][Nor] New - Implicit casts not considered with compound assignments

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Tue Dec 19 08:31:22 EST 2006


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by martin.voelkle at gmail.com.

http://bugzilla.ximian.com/show_bug.cgi?id=80313

--- shadow/80313	2006-12-19 08:31:22.000000000 -0500
+++ shadow/80313.tmp.4182	2006-12-19 08:31:22.000000000 -0500
@@ -0,0 +1,56 @@
+Bug#: 80313
+Product: Mono: Compilers
+Version: 1.2
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: C#
+AssignedTo: rharinath at novell.com                            
+ReportedBy: martin.voelkle at gmail.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Implicit casts not considered with compound assignments
+
+Description of Problem:
+
+Similar to bug80288:
+
+using System;
+
+namespace Bugs
+{
+    class Bug1
+    {
+        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)
+        {
+            MyInt i = 3;
+            i &= (4 + i);
+            Console.WriteLine(i);
+        }
+    }
+}
+
+Assignment "i &= (4 + i)" fails although (i & (4 + i)) is implicitely
+convertible to MyInt.


More information about the mono-bugs mailing list