Skip to content

feat: Add {:and, subtypes} option type.#246

Merged
zachdaniel merged 1 commit intomainfrom
options-and-type
Dec 23, 2025
Merged

feat: Add {:and, subtypes} option type.#246
zachdaniel merged 1 commit intomainfrom
options-and-type

Conversation

@jimsynz
Copy link
Copy Markdown
Contributor

@jimsynz jimsynz commented Dec 13, 2025

This allows Beam Bots to validate modules using types like {:and, [{:behaviour, GenServer}, {:behaviour, BB.Safety}]} for example.

Contributor checklist

Leave anything that you believe does not apply unchecked.

  • 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

This allows Beam Bots to validate modules using types like `{:and, [{:behaviour, GenServer}, {:behaviour, BB.Safety}]}` for example.
@jimsynz jimsynz requested a review from zachdaniel December 13, 2025 23:19
@jimsynz jimsynz self-assigned this Dec 13, 2025
end

# Treat `and` like `or` because any of the input types is valid.
def spec_for_type({:and, subtypes}, opts), do: spec_for_type({:or, subtypes}, opts)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to not have to do this. We may want to do something to make it look nice in docs?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually yeah I don't see a handler for the docs bit here.

@zachdaniel zachdaniel merged commit da2ca7d into main Dec 23, 2025
23 checks passed
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.

2 participants