Skip to content
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

Minor bug in error message maps:update #8719

Closed
ThomasArts opened this issue Aug 14, 2024 · 1 comment · Fixed by #8721
Closed

Minor bug in error message maps:update #8719

ThomasArts opened this issue Aug 14, 2024 · 1 comment · Fixed by #8721
Assignees
Labels
bug Issue is reported as a bug team:VM Assigned to OTP team VM

Comments

@ThomasArts
Copy link
Contributor

Describe the bug
The error message returned from maps:update is misleading.

To Reproduce
Open an Erlang shell. Type:

2> maps:update(u, 1, #{}).
** exception error: bad key: u
     in function  maps:update/3
        called as maps:update(u,1,#{})
        *** argument 3: not a map

Indeed, the key is a bad, key, but I would argue that the 3rd argument is a valid map.
This is not just for the empty map, but even for:

3> maps:update(u, 1, #{c => 1}).
** exception error: bad key: u
     in function  maps:update/3
        called as maps:update(u,1,#{c => 1})
        *** argument 3: not a map

Expected behavior
I expect the error message not to complain about the actual third argument.

Affected versions
The OTP versions that are affected by this bug.
Tested this on OTP-26.2.5.

@ThomasArts ThomasArts added the bug Issue is reported as a bug label Aug 14, 2024
@jhogberg jhogberg self-assigned this Aug 14, 2024
@jhogberg jhogberg added the team:VM Assigned to OTP team VM label Aug 14, 2024
@jhogberg
Copy link
Contributor

Thanks for your report, I've fixed it in #8721 :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is reported as a bug team:VM Assigned to OTP team VM
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants