You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A much more minor weirdness is that the documentation predicts a badarg exception, but even with +no_fold I am getting a badkey exception. I suspect this just a small typo in the documentation.
Fix an unsafe optimization that would remove a map update operation
that is supposed fail. For example:
foo() ->
#{}#{key := value},
ok.
Instead of raising an exception, `foo/0` would return `ok`.
Closeserlang#6960
To Reproduce
Running the following code:
with the following:
outputs
hello
.Expected behavior
I would expect a tuple containing an exception, since the map update operation is supposed to throw with
badarg
in this context (https://www.erlang.org/doc/reference_manual/expressions.html#map-expressions).Affected versions
master
Additional context
Giving the argument
+no_fold
to erlc fixes this bug, resulting in the following output:The text was updated successfully, but these errors were encountered: