Skip to content

Refactor or-pattern type checking by category - #85

Merged
bradcypert merged 1 commit into
mainfrom
issue-74-or-pattern-categories
Oct 5, 2026
Merged

bradcypert merged 1 commit into
mainfrom
issue-74-or-pattern-categories

Conversation

@bradcypert

Copy link
Copy Markdown
Owner

Or-pattern checking now dispatches by literal, tag-shaped, and structural category. Literal alternatives constrain the scrutinee without constructing binding environments; tag and structural alternatives share explicit rules requiring identical binding names, unique names within each alternative, and unifiable binding types.

Issue #74 predates #75 (merged in PR #82), which enabled tag and structural alternatives. This refactor preserves those supported shapes and their existing rejection diagnostics rather than disabling them. Constructor heads still resolve through the ordinary pattern binder, including positional struct syntax.

Adds category unit coverage, execution cases for string/float/bool and nested/mixed alternatives, and a structural binding-type rejection fixture. Rebuilds the tracked compiler.

Validation:

  • bootstrap/self-test (12 passed)
  • bootstrap/corpus-check (including AddressSanitizer and leak checks)
  • bootstrap/bootstrap-check
  • bootstrap/check-seed
  • bootstrap/fmt-check
  • git diff --check

Closes #74

@bradcypert
bradcypert merged commit 861dc5b into main Oct 5, 2026
16 checks passed
@bradcypert
bradcypert deleted the issue-74-or-pattern-categories branch October 5, 2026 01:41
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.

Refactor or-pattern type checking by pattern category

1 participant