[Mono-bugs] [Bug 53437][Nor] New - compiler can't handle enums in a method

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Tue, 27 Jan 2004 19:34:57 -0500 (EST)


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 jason.uppenborn@atcoitek.com.

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

--- shadow/53437	2004-01-27 19:34:57.000000000 -0500
+++ shadow/53437.tmp.1775	2004-01-27 19:34:57.000000000 -0500
@@ -0,0 +1,81 @@
+Bug#: 53437
+Product: Mono/Compilers
+Version: unspecified
+OS: 
+OS Details: XP
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: C#
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: jason.uppenborn@atcoitek.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: compiler can't handle enums in a method
+
+Description of Problem:
+
+Compiler complains about enum declared / initialized within a method.
+
+
+Steps to reproduce the problem:
+1. Create source file Try.cs:
+
+using System;
+
+namespace Jason {
+
+public class Try {
+    
+    public static void Main( ) {
+
+        enum Temperature {
+            FreezingPoint = 0,
+            BoilingPoint = 100
+        }
+    
+        Console.WriteLine("Freezing point of water: {0}", 
+            (int) Temperature.FreezingPoint );
+
+    } // main()
+} // class Try
+} // namespace Jason
+
+2. Compile: mcs /r:System Try.cs
+ 
+
+Actual Results:
+M:\Mono\Source>mcs /r:System Try.cs
+syntax error, expecting BASE BOOL BREAK BYTE CHAR CHECKED CONST CONTINUE 
+DECIMAL
+ DELEGATE DO DOUBLE FALSE FIXED FLOAT FOR FOREACH GOTO IF INT LOCK LONG 
+NEW NULL
+ OBJECT RETURN SBYTE SHORT SIZEOF STRING SWITCH THIS THROW TRUE TRY 
+TYPEOF UINT
+ULONG UNCHECKED UNSAFE USHORT USING VOID WHILE YIELD OPEN_BRACE 
+CLOSE_BRACE OPEN
+_PARENS SEMICOLON TILDE PLUS MINUS BANG BITWISE_AND STAR OP_INC OP_DEC 
+LITERAL_I
+NTEGER LITERAL_FLOAT LITERAL_DOUBLE LITERAL_DECIMAL LITERAL_CHARACTER 
+LITERAL_ST
+RING IDENTIFIER
+Try.cs(9) error CS1002: Expecting `;'
+Compilation failed: 1 error(s), 0 warnings
+
+
+
+Expected Results:
+M:\Mono\Source>mcs /r:System Try.cs
+Compilation succeeded
+
+M:\Mono\Source>try
+Freezing point of water: 0
+
+
+How often does this happen? 
+Every time
+
+Additional Information: