-
Notifications
You must be signed in to change notification settings - Fork 13.3k
"as bool" does not properly convert its argument. #7311
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
Comments
I think we're handling |
I don't think we should allow |
Visiting for triage. Looks like this will be fixed shortly. Nothing to add. |
This is currently unsound since `bool` is represented as `i8`. It will become sound when `bool` is stored as `i8` but always used as `i1`. However, the current behaviour will always be identical to `x & 1 != 0`, so there's no need for it. It's also surprising, since `x != 0` is the expected behaviour. Closes #7311 d0a1176 r=huonw e4a76e6 r=thestinger
foo as bool
should result in an i1, not an i8. This can lead to various unexpected or hard to debug behavior. See:The text was updated successfully, but these errors were encountered: