Skip to content

fix: refuse a value that is not a range on every path that takes one - #2883

Merged
zachdaniel merged 3 commits into
ash-project:mainfrom
matt-beanland:fix/refuse-non-range
Aug 19, 2026
Merged

zachdaniel merged 3 commits into
ash-project:mainfrom
matt-beanland:fix/refuse-non-range

Conversation

@matt-beanland

@matt-beanland matt-beanland commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Contributor checklist

  • I accept the AI Policy, or AI was not used in the creation of this PR.
  • Bug fixes include regression tests
  • Chores
  • Documentation changes
  • Features include unit/acceptance tests
  • Refactoring
  • Update dependencies

Closes #2882

Summary

A value that is not a range raised instead of being refused — UndefinedFunctionError from cast_input/2 and cast_stored/2, FunctionClauseError from apply_constraints/2.

The fix required guarding extract/1 against structs, and giving apply_constraints/2 a fallback clause.

Requires #2880, since it touched the same two functions.

@zachdaniel
zachdaniel merged commit de2e90b into ash-project:main Aug 19, 2026
28 checks passed
@zachdaniel

Copy link
Copy Markdown
Contributor

🚀 Thank you for your contribution! 🚀

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.

Ash.Type.Range raises when casting a struct that is not a range

2 participants