[Mono-bugs] [Bug 35971][Nor] New - mcs throws a different error number for a misformed "foreach" expression

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
19 Dec 2002 21:47:15 -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 bugbuddy-import@ximian.com.

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

--- shadow/35971	Thu Dec 19 16:47:15 2002
+++ shadow/35971.tmp.29339	Thu Dec 19 16:47:15 2002
@@ -0,0 +1,89 @@
+Bug#: 35971
+Product: Mono/MCS
+Version: unspecified
+OS: GNU/Linux [Other]
+OS Details: 
+Status: UNCONFIRMED   
+Resolution: 
+Severity: Unknown
+Priority: Normal
+Component: Misc
+AssignedTo: triage@ximian.com                            
+ReportedBy: cesar@ciencias.unam.mx               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: mcs throws a different error number for a  misformed "foreach" expression
+
+Package: Mono/MCS
+Priority: Normal
+Version: cvs version from Dec. 19, 2002
+Synopsis: mcs throws a different error number for a  misformed "foreach" expression
+Bugzilla-Product: Mono/MCS
+Bugzilla-Component: Misc
+
+Description:
+Description of Problem:
+
+mcs throws a different error number for a  misformed "foreach"
+expression
+The foreach expression must have the type and the identifier, 
+in the code attached the identifier is missed and mcs throws error
+number cs01002.
+
+Steps to reproduce the problem:
+Compile the code attached.
+
+Actual Results:
+syntax error, expecting OPEN_BRACKET STAR IDENTIFIER
+cs0230.cs(13) error CS1002: Expecting `;'
+syntax error, expecting end-of-file EOF ABSTRACT CLASS DELEGATE ENUM
+EXTERN INTERFACE INTERNAL NAMESPACE NEW OVERRIDE PRIVATE PROTECTED
+PUBLIC READONLY SEALED STATIC STRUCT UNSAFE USING VIRTUAL VOLATILE
+OPEN_BRACKET
+cs0230.cs(17) error CS-0025: : Parsing error 
+Mono.CSharp.yyParser.yyException: irrecoverable syntax error
+in <0x006fa> 00 Mono.CSharp.CSharpParser:yyparse
+(Mono.CSharp.yyParser.yyInput)
+in <0x0006e> 00 Mono.CSharp.CSharpParser:parse ()
+
+Compilation failed: 2 error(s), 0 warnings
+
+
+Expected Results:
+
+cs0230.cs(13,20): error CS0230: Type and identifier are both required in
+a foreach statement
+
+How often does this happen?
+always
+
+Additional Information:
+I paste sample code here. And add it to mcs/errors/
+
+//
+// CS0230.cs: foreach statement mus contain the type and the variable
+identifier
+//
+
+using System;
+
+class X
+{
+   public static void Main()
+   {
+      int [] a = new int [5] {5, 4, 3, 2, 1};
+
+      foreach (int in a) {
+	      Console.WriteLine (x);
+      }
+   }
+}
+
+
+
+Setting qa contact to the default for this product.
+   This bug either had no qa contact or an invalid one.
+
+