[Mono-bugs] [Bug 35931][Wis] New - enum example from TiC# fails
bugzilla-daemon@rocky.ximian.com
bugzilla-daemon@rocky.ximian.com
19 Dec 2002 15:59:04 -0000
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 jpo234@netscape.net.
http://bugzilla.ximian.com/show_bug.cgi?id=35931
--- shadow/35931 Thu Dec 19 10:59:04 2002
+++ shadow/35931.tmp.726 Thu Dec 19 10:59:04 2002
@@ -0,0 +1,60 @@
+Bug#: 35931
+Product: Mono/MCS
+Version: unspecified
+OS:
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Wishlist
+Component: Misc
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: jpo234@netscape.net
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: enum example from TiC# fails
+
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+Adding enums as shown in TiC# fails:
+
+using System;
+
+class EnumTest {
+ enum Coin: short {
+ Penny = 1,
+ Nickel = 5,
+ Dime = 10,
+ Quarter = 25,
+ Dollar = 100
+ }
+
+ public static void Main ()
+ {
+ short change = (short)(Coin.Penny + Coin.Nickel);
+ Console.WriteLine (change);
+ }
+}
+
+Steps to reproduce the problem:
+1. try to compile the program
+
+Actual Results:
+enums.cs(14) error CS0019: Operator + cannot be applied to operands of type
+`EnumTest+Coin' and `EnumTest+Coin'
+enums.cs(15) error CS0165: Use of unassigned local variable `change'
+Compilation failed: 2 error(s), 0 warnings
+
+
+Expected Results:
+Compilation succeeded
+
+
+How often does this happen?
+Always.
+
+Additional Information:
+none