BUG: You receive a "CS0030" compilation error code while explicitly converting enum type to char type (814902)
The information in this article applies to:
- Microsoft Visual C# .NET (2002)
SYMPTOMSIf you explicitly convert enum type to char type, you may receive the following compilation error
message (CS0030): Cannot convert type '<Your enum
type>' to 'char' STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are
listed at the beginning of this article.
WORKAROUNDTo work around this problem, first explicitly convert enum type to int, and then explicitly convert int type to char type. You can do this with the following code: char ch = (char) (int) TestEnum.Val; Content Maintenance:3155
Modification Type: | Major | Last Reviewed: | 1/16/2006 |
---|
Keywords: | kbCompiler kbProgramming kbbug KB814902 kbAudDeveloper kbAudITPRO |
---|
|