Skip to content

Add warning about %{} pattern matching#23

Merged
zachdaniel merged 2 commits into
ash-project:mainfrom
jlgeering:fix-empty-map-pattern-matching
Aug 23, 2025
Merged

Add warning about %{} pattern matching#23
zachdaniel merged 2 commits into
ash-project:mainfrom
jlgeering:fix-empty-map-pattern-matching

Conversation

@jlgeering
Copy link
Copy Markdown
Contributor

Summary

  • Add warning that %{} matches any map, not just empty maps
  • Recommend using map_size(map) == 0 guard for true empty map detection

Fixes #21

Comment thread usage-rules/elixir.md Outdated
@jlgeering jlgeering changed the title Add critical warning about %{} pattern matching Add warning about %{} pattern matching Aug 23, 2025
@zachdaniel zachdaniel merged commit e67407f into ash-project:main Aug 23, 2025
@zachdaniel
Copy link
Copy Markdown
Contributor

🚀 Thank you for your contribution! 🚀

@jlgeering jlgeering deleted the fix-empty-map-pattern-matching branch August 28, 2025 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

new usage rule: cannot match with %{} to check for empty map

2 participants