Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible to create BitX with invalid value (out of range) #8

Open
fanoI opened this issue Apr 30, 2017 · 1 comment
Open

Possible to create BitX with invalid value (out of range) #8

fanoI opened this issue Apr 30, 2017 · 1 comment

Comments

@fanoI
Copy link

fanoI commented Apr 30, 2017

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...

@ufcpp
Copy link
Owner

ufcpp commented May 2, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants