Bug 313464 (MONO52527) - cast
Summary: cast
Status: RESOLVED MOVED
Alias: MONO52527
Product: Mono: Compilers
Classification: Mono
Component: C# (show other bugs)
Version: unspecified
Hardware: Other Red Hat 9.0
: P3 - Medium : Enhancement
Target Milestone: ---
Assignee: Mono Bugs
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords: dogfood
Depends on:
Blocks:
 
Reported: 2003-12-24 03:55 UTC by linxiaoming
Modified: 2007-09-15 21:24 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wiest 2007-09-15 18:22:56 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"