Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
If an enum is a ulong and has a value set by shifts, the generated code shifts by a ulong, which is illegal. It should always shift by an int.
Example from Pop:
public enum POPAnimationClampFlags : ulong
None = 0uL,
Start = 0uL << 1uL,
End = 1uL << 1uL,
Both = kPOPAnimationClampEnd | kPOPAnimationClampStart
Good catch. This is due to NRefactory's lame writing of literals - it always tacks on the 'u' and 'L' suffixes for uint, long, and ulong primitives.
I've overridden the writer for those primitives such that if a UInt32, Int64, or UInt64 can fit safely into an Int32, it will convert them to Int32 before writing.
This wasn't specific to the RHS of a shift, rather any primitive integer literal. The type of the literal is determined by the type of the encapsulating enum.