-
Notifications
You must be signed in to change notification settings - Fork 471
Fix crash when using bitwise not on incompatible type #7965
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
Conversation
4a3fd8f
to
fa63fde
Compare
rescript
@rescript/darwin-arm64
@rescript/darwin-x64
@rescript/linux-arm64
@rescript/linux-x64
@rescript/runtime
@rescript/win32-x64
commit: |
It shouldn't be parsed as a bitwise operator there. Also, the resolution may be conflicted with #7894 |
Ah, right, bitwise should be So we have two problems:
The first is already resolved by this PR. If we call
What exactly may be conflicted how? |
b6a8dee
to
b012f97
Compare
| _ -> ( | ||
try | ||
unify env lhs_type (instance_def Predef.type_int); | ||
instance_def Predef.type_int | ||
with Ctype.Unify trace -> | ||
raise | ||
(Error (lhs.exp_loc, env, Expr_type_clash {trace; context = None})) | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this needed now but wasn't before...?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it was always needed, but for a long time nobody noticed that it would crash if you passed a non-matching type, until this was reported in #7960.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah right. Good catch then!
Fixes #7960