https://bugzilla.novell.com/show_bug.cgi?id=342584
Summary: Cast from IntPtr to Enum fails with CS0030
Product: Mono: Compilers
Version: 1.2.6
Platform: i386
OS/Version: Ubuntu
Status: NEW
Severity: Normal
Priority: P5 - None
Component: C#
AssignedTo: [EMAIL PROTECTED]
ReportedBy: [EMAIL PROTECTED]
QAContact: [EMAIL PROTECTED]
Found By: ---
The following code compiles on 1.2.4, 1.2.5 and csc.exe (2.0), but fails on
1.2.6 Preview 2 (mcs, gmcs).
using System;
namespace Test
{
enum Key { A }
class Regression
{
public static void Main()
{
IntPtr a = new IntPtr(1);
Key k = (Key)a;
}
}
}
> gmcs enum_intptr.cs
enum_intptr.cs(12,22): error CS0030: Cannot convert type `System.IntPtr' to
`Test.Key'
Compilation failed: 1 error(s), 0 warnings
--
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.
_______________________________________________
mono-bugs maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs