[Mono-bugs] [Bug 392155] New: C# parser gets confused when casting the result of byte. Parse
bugzilla_noreply at novell.com
bugzilla_noreply at novell.com
Mon May 19 12:42:43 EDT 2008
https://bugzilla.novell.com/show_bug.cgi?id=392155
Summary: C# parser gets confused when casting the result of
byte.Parse
Product: Mono: Compilers
Version: unspecified
Platform: x86
OS/Version: Mac OS X 10.5
Status: NEW
Severity: Normal
Priority: P5 - None
Component: C#
AssignedTo: mono-bugs at lists.ximian.com
ReportedBy: brian at sooloos.com
QAContact: mono-bugs at lists.ximian.com
Found By: Other
Code:
using System;
public class Foo
{
enum _DataType : byte {Foop}
public static void Main(string[] args)
{
_DataType dt = (_DataType)byte.Parse("123");
}
}
z at z ~ $ gmcs t.cs
t.cs(8,35): error CS1002: Expecting `;'
Compilation failed: 1 error(s), 0 warnings
If I capitalize the 'byte' in 'byte.Parse', it compiles successfully.
Similarly, if I put an extra set of parenthesis around byte.Parse("123") it
compiles successfully. Something about byte being a type seems to be confusing
the compiler.
This compiles successfully on the microsoft toolchain(s).
--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
More information about the mono-bugs
mailing list