VB -> C#: wrong conversation of hex constants
VB.Net input code
Const value = &HFFFFFFFF value.Should.Be.EqualTo(-1)
Erroneous output
const int value = 0xFFFFFFFF; this doesn't compile (cannot convert uint to int)
Expected output
var value = int.Parse("FFFFFFFF", System.Globalization.NumberStyles.HexNumber);
when we want to keep value as constant (with hex value as comment) const int value = -1; // 0xFFFFFFFF
Details
- Product in use: VS extension
- Version in use: 8.3.1
- Did you see it working in a previous version, which? No
Thanks for the report. Good thinking with the two different fixes. Since it's a compile error right now, even just a PR to do the const style one (with comment) everywhere would be a worthwhile improvement
This implementation fails for the input:
Const mh As ULong = &HffffffffffffffffUL
Because the value is too large for an int.
Should I open a new issue to follow up with these findings or do you want to reopen this one?
Thanks, I'll reopen this