Bugzilla – Bug 313464
cast
Last modified: 2007-09-15 21:24:23 UTC
---- Reported by xiaoming.lin@longshine.com 2003-12-23 20:55:16 MST ---- Please fill in this template when reporting a bug, unless you know what you are doing. Description of Problem: Steps to reproduce the problem: 1. class MyClass{ public enum FieldType {ftUnknown = 0, ftString} public static void Main(){ System.Console.WriteLine( (FieldType) int.Parse("1") ); } } 2. mcs b.cs 3. Actual Results: syntax error, expecting AS IS CLOSE_BRACE OPEN_BRACKET CLOSE_BRACKET OPEN_PARENS CLOSE_PARENS DOT COMMA COLON SEMICOLON PLUS MINUS ASSIGN OP_LT OP_GT BITWISE_AND BITWISE_OR STAR PERCENT DIV CARRET INTERR OP_INC OP_DEC OP_SHIFT_LEFT OP_SHIFT_RIGHT OP_LE OP_GE OP_EQ OP_NE OP_AND OP_OR 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 b.cs(7) error CS1002: Expecting `;' Compilation failed: 1 error(s), 0 warnings Expected Results: Compilation succeeded How often does this happen? always Additional Information: 1.the csc can compliate it successfully. 2.change System.Console.WriteLine( (FieldType) int.Parse("1") ); to System.Console.WriteLine( (FieldType) (int.Parse("1")) ); then mcs can compliate it successfully. ---- Additional Comments From bmaurer@users.sf.net 2003-12-24 15:37:55 MST ---- *** This bug has been marked as a duplicate of https://bugzilla.novell.com/show_bug.cgi?id=MONO49836 *** This bug was marked DUPLICATE in the database it was moved from. Changing resolution to "MOVED"