[Mono-bugs] [Bug 41290][Min] New - Different enums comparison is compiled fine
bugzilla-daemon@rocky.ximian.com
bugzilla-daemon@rocky.ximian.com
Sun, 13 Apr 2003 00:40:53 -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 gonzalo@ximian.com.
http://bugzilla.ximian.com/show_bug.cgi?id=41290
--- shadow/41290 Sun Apr 13 00:40:53 2003
+++ shadow/41290.tmp.5517 Sun Apr 13 00:40:53 2003
@@ -0,0 +1,47 @@
+Bug#: 41290
+Product: Mono/MCS
+Version: unspecified
+OS: All
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Minor
+Component: Misc
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: gonzalo@ximian.com
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: Different enums comparison is compiled fine
+
+Try compiling this:
+-----
+enum A
+{
+ A1,
+ A2
+}
+
+enum B
+{
+ B1,
+ B2
+}
+
+class C
+{
+ static void Main ()
+ {
+ A a = A.A1;
+ System.Console.WriteLine (a == B.B1);
+ }
+}
+-----
+Actual Results:
+Compilation successful.
+
+Expected Results:
+enums.cs(18,29): error CS0019: Operator '==' cannot be applied to operands
+of type 'A' and 'B'