-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
bugIssue is reported as a bugIssue is reported as a bugteam:VMAssigned to OTP team VMAssigned to OTP team VM
Description
Describe the bug
Running the following erlang code:
f(_, _V1) when ((ok == _V1) and (ok =/= trunc(ok))) or (ok < _V1) ->
a;
f(_V0, _) ->
_V0.
wrapper0() ->
io:write(f(b, [])).
with the following two commands:
erlc -W0 ~/minimized/test329322.erl
erl -pa . -noshell -s test329322 wrapper0 -s init stop
results in the output a
.
Passing +no_bool_opt
to erlc makes it output b
instead.
Expected behavior
trunc(ok)
is always going to throw an exception, and so the whole guard should fail.
So the behavior with +no_bool_opt
is I believe the right one, and should also occur without that option.
Affected versions
Metadata
Metadata
Assignees
Labels
bugIssue is reported as a bugIssue is reported as a bugteam:VMAssigned to OTP team VMAssigned to OTP team VM