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 [EMAIL PROTECTED]

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

--- shadow/79070        2006-08-13 13:10:48.000000000 -0400
+++ shadow/79070.tmp.5087       2006-08-13 13:10:48.000000000 -0400
@@ -0,0 +1,37 @@
+Bug#: 79070
+Product: Mono: Compilers
+Version: 1.0
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: C#
+AssignedTo: [EMAIL PROTECTED]                            
+ReportedBy: [EMAIL PROTECTED]               
+QAContact: [EMAIL PROTECTED]
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Implicit conversion to decimal on both operands
+
+The following code will compile with Microsoft csc, but mcs aborts  
+compilation with "test.cs(9,34): error CS0019: Operator `+' cannot be  
+applied to operands of type `MyDecimal' and `MyDecimal'". The same code  
+works with mcs if I change decimal to int, so (for whatever reason, I 
+couldn't find one in the C# specification) this behaviour depends on the 
+type. 
+  
+   
+class MyDecimal {   
+    public static implicit operator decimal(MyDecimal i) { return 42; }   
+}   
+   
+class TestProgram {   
+    static void Main(string[] args)   
+    {   
+        MyDecimal a = new MyDecimal(), b = new MyDecimal();   
+        System.Console.WriteLine(a + b);   
+    }   
+}
_______________________________________________
mono-bugs maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs

Reply via email to