Fix crash when using bitwise not on incompatible type#7965
Fix crash when using bitwise not on incompatible type#7965cknitt merged 3 commits intorescript-lang:masterfrom
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.
Why is this needed now but wasn't before...?
There was a problem hiding this comment.
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.
Fixes #7960