I have an enumeration like this in the old part of the code:
[Flags]
public enum Example: uint
{
Foo = 0x00000001,
Bar = 0xC0000000
}
FxCop now complains about this enum using uint rather than int as a support field. (And I was instructed to get this code as clean as FxCop as much as possible ...) But there is an existing enum value that uses the upper order bit of the enumeration, and I cannot change this because it was saved in a format on disk. When I try to compile this, the C # compiler rightly complains:
error CS0266: Cannot implicitly convert type 'uint' to 'int'. An explicit conversion exists (are you missing a cast?)
So, I was going to change it to this:
[Flags]
public enum Example
{
Foo = 0x00000001,
Bar = (int)0xC0000000
}
, , . , , unsigned int?