[Mono-bugs] [Bug 43860][Cos] New - After parse error, compiler throws InvalidCastException

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
Thu, 29 May 2003 09:57:00 -0400 (EDT)


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 sestoft@dina.kvl.dk.

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

--- shadow/43860	Thu May 29 09:57:00 2003
+++ shadow/43860.tmp.31888	Thu May 29 09:57:00 2003
@@ -0,0 +1,56 @@
+Bug#: 43860
+Product: Mono/MCS
+Version: 
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Cosmetic
+Component: Misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: sestoft@dina.kvl.dk               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: After parse error, compiler throws InvalidCastException
+
+Description of Problem:
+
+After parse error, compiler throws InvalidCastException
+
+Steps to reproduce the problem:
+1. Compile this program:
+
+class MyTest {
+  public static void Main(String[] args) {
+    MyTest 121;
+  }
+}  
+
+Actual Results:
+
+syntax error, expecting OPEN_BRACKET OPEN_PARENS DOT COLON ASSIGN STAR
+OP_INC OP_DEC OP_MULT_ASSIGN OP_DIV_ASSIGN OP_MOD_ASSIGN OP_ADD_ASSIGN
+OP_SUB_ASSIGN OP_SHIFT_LEFT_ASSIGN OP_SHIFT_RIGHT_ASSIGN OP_AND_ASSIGN
+OP_XOR_ASSIGN OP_OR_ASSIGN
+OP_PTR IDENTIFIER
+monobug2.cs(5) error CS1002: Expecting `;'
+monobug2.cs(5) error CS-0025: : Parsing error
+System.InvalidCastException: Cannot cast from source type to destination
+type
+in <0x0e1fb> 00 Mono.CSharp.CSharpParser:yyparse
+(Mono.CSharp.yyParser.yyInput)
+in <0x00075> 00 Mono.CSharp.CSharpParser:parse ()
+ 
+Compilation failed: 2 error(s), 0 warnings  
+
+Expected Results:
+
+Parsing error message but no exception from compiler.
+
+How often does this happen? 
+
+
+Additional Information: