Skip to content

Document Map.fetch!/2 exception in the doc test #14573

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

Merged
merged 2 commits into from
Jun 12, 2025

Conversation

PragTob
Copy link
Contributor

@PragTob PragTob commented Jun 11, 2025

👋 Thank you all for your excellent work!

This mirrors Map.fetch/2 and thought it was nice to have there for easy & quick overview purposes - so I quickly added it.

Couple of points:

  • I couldn't figure out how to correctly show the map of not found in - seems difficult due to the \n\n in the error messages, grabbed the ... trick from the doc tests of Access.key!/1.
  • The type system now warns that this will error in this specific test which is annoying and I'm not sure how to get rid of it:
tobi@qiqi:~/github/elixir(main)$ make test_stdlib
==> elixir (compile)
==> elixir (ex_unit)
warning: the call to map_get/2 will fail with a '{badkey,b}' exception
└─ (for doctest at) lib/map.ex:319

Running ExUnit with seed: 618006, max_cases: 48
Excluding tags: [windows: true]

I understand this isn't crucial so if the annoyance of dealing with the warning is big enough I'm happy to have this closed :)

Thanks y'all! 💚

Also mirrors `Map.fetch/2` and thought it was nice to have there
for easy & quick overview purposes.
@PragTob
Copy link
Contributor Author

PragTob commented Jun 12, 2025

Done and thank you both! 💚

IMG_20180426_161419

@josevalim josevalim merged commit 7ad1450 into elixir-lang:main Jun 12, 2025
@josevalim
Copy link
Member

💚 💙 💜 💛 ❤️

@PragTob PragTob deleted the map-fetch-exception-doc-test branch June 12, 2025 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants