[Mono-bugs] [Bug 32464][Wis] New - mcs does not check for duplicate enum definition

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
17 Oct 2002 19:30:34 -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 danmorg@sc.rr.com.

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

--- shadow/32464	Thu Oct 17 15:30:34 2002
+++ shadow/32464.tmp.28887	Thu Oct 17 15:30:34 2002
@@ -0,0 +1,49 @@
+Bug#: 32464
+Product: Mono/MCS
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: Misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: danmorg@sc.rr.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: mcs does not check for duplicate enum definition
+
+mcs should check to see if it has already added an enum named SomeEnum to 
+its hash table of types.  Currently, an exception is thrown trying to add 
+a duplicate enum type definition to a hash table.  This exception should 
+not be seen by a user.  An error message like csc does should be shown.
+
+csc reports:
+DupeEnumTest.cs(8,13): error CS0101: The namespace '' already contains a
+        definition for 'SomeEnum'
+DupeEnumTest.cs(3,13): (Location of symbol related to previous error)
+
+// DupeEnumTest.cs - test duplicate enum found
+using System;
+
+public enum SomeEnum {
+	Something1,
+	Something2
+}
+
+public enum SomeEnum {
+	Dog,
+	Fish,
+	Cat
+}
+
+public class DupeEnumTest {
+	public static void Main(string[] args) {
+		SomeEnum someEnum = SomeEnum.Dog;
+		Console.WriteLine("SomeEnum Result: " + someEnum.ToString
+());
+	}
+}