[Mono-bugs] [Bug 27927][Maj] New - Error in array conversion

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
17 Jul 2002 23:07:39 -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 obe1line@ntlworld.com.

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

--- shadow/27927	Wed Jul 17 19:07:39 2002
+++ shadow/27927.tmp.29871	Wed Jul 17 19:07:39 2002
@@ -0,0 +1,59 @@
+Bug#: 27927
+Product: Mono/MCS
+Version: unspecified
+OS: 
+OS Details: Windows XP
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Major
+Component: Misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: obe1line@ntlworld.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Error in array conversion
+
+Please fill in this template when reporting a bug, unless you know what 
+you are doing.
+Description of Problem:
+Compiler error when using enum array casting - see included code and error
+
+Steps to reproduce the problem:
+run mcs on the following code (saved as test2.cs):
+[>>>]
+
+ using System;
+ 
+
+ public class Test2
+ {
+     public enum DAYS: byte {Monday, Tuesday, Wednesday, Thursday, Friday, 
+Saturday, Sunday}
+ 
+     public static void Main()
+     {
+         Array dayArray = Enum.GetValues(typeof(DAYS));
+ 
+         foreach (DAYS day in dayArray)
+             Console.WriteLine("Number {1} of Test2.DAYS is {0}", day, 
+day.ToString("d")); 
+     }
+ }
+
+[<<<]
+
+Actual Results:
+test2.cs(13) error CS0030: Cannot convert type 'System.Array' 
+to 'Test2+DAYS'
+Compilation failed: 1 error(s), 0 warnings
+
+Expected Results:
+Compilation succeeded (get this if use monomcs)
+
+How often does this happen? 
+Every time compiled
+
+Additional Information: