BitFields
BitFields copied to clipboard
Possible to create BitX with invalid value (out of range)
This works correctly:
Bit3 b3 = 99;
I got the expected error: "Constant value '99' cannot be converted to a 'Bit3'"
but this passes:
Bit3 b3 = 98 + 1;
Admittedly is strange to use the '+' on a Bit... I don't if is possible to catch this error too or not...
It's on todo list.
https://github.com/ufcpp/BitFields/blob/master/src/BitFieldsAnalyzer/BitFieldsAnalyzer/BitNAnalyzer.cs#L52
I think it's necessary but a bit hard task.