[Mono-bugs] [Bug 41294][Nor] New - Enum of zero with [Flag] Attribute returns empty string
bugzilla-daemon@rocky.ximian.com
bugzilla-daemon@rocky.ximian.com
Sun, 13 Apr 2003 06:02:23 -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 r.h.lee@attbi.com.
http://bugzilla.ximian.com/show_bug.cgi?id=41294
--- shadow/41294 Sun Apr 13 06:02:22 2003
+++ shadow/41294.tmp.8235 Sun Apr 13 06:02:22 2003
@@ -0,0 +1,60 @@
+Bug#: 41294
+Product: Mono/Class Libraries
+Version: unspecified
+OS:
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Normal
+Component: System
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: r.h.lee@attbi.com
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: Enum of zero with [Flag] Attribute returns empty string
+
+A call to ToString on an Enum with a value of zero returns string.Empty
+instead of the Enum name.
+
+---begin cut---
+
+using System;
+
+[Flags]
+public enum FE1 {
+ A=0,
+ B=1,
+ C=2,
+ D=4,
+}
+
+public class Test {
+ public static void Main () {
+ bool pass;
+ string estr;
+
+ estr=FE1.A.ToString();
+ pass=estr=="A";
+ Console.Write (estr);
+ Console.WriteLine (pass.ToString());
+ }
+}
+
+---end cut---
+
+Results:
+Test case output:
+>> <string.empty>
+>> False
+
+
+Expected:
+>> A
+>> True
+
+
+How often does it happen?
+Always