[Mono-bugs] [Bug 49823][Nor] New - CS0019 detected for comparable instances

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sat, 18 Oct 2003 09:17:10 -0400 (EDT)


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 rodolfocampero@hotmail.com.

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

--- shadow/49823	2003-10-18 09:17:10.000000000 -0400
+++ shadow/49823.tmp.11010	2003-10-18 09:17:10.000000000 -0400
@@ -0,0 +1,52 @@
+Bug#: 49823
+Product: Mono/MCS
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: Unknown
+Priority: Normal
+Component: Misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: rodolfocampero@hotmail.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: CS0019 detected for comparable instances
+
+Description of Problem:
+mcs stop compilation, uncorrectly detecting a CS0019 error, for a valid 
+input program.
+
+Steps to reproduce the problem:
+1. Copy the following program in a text file called InterfaceTest.cs:
+using System;
+namespace Test {
+        public class Test {
+                public static void Main(string[] args) {
+                        BaseClass baseRef = new DerivedClass();
+                        ITest interfaceRef = (ITest)baseRef;
+                        Console.WriteLine("Is this wrong? {0}", 
+(interfaceRef!=baseRef));
+                }
+        }
+        public interface ITest {}
+        public class BaseClass {}
+        public class DerivedClass: BaseClass, ITest {}
+}
+
+2. Try to compile the program using:
+mcs InterfaceTest.cs
+
+Actual Results:
+InterfaceTest.cs(7) error CS0019: Operator != cannot be applied to operands 
+of type `Test.ITest' and `Test.BaseClass'
+Compilation failed: 1 error(s), 0 warnings
+
+Expected Results:
+Compilation successful.
+
+How often does this happen? 
+Always.