Skip to content
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

🥅 Improve SequenceSet frozen errors #331

Merged
merged 1 commit into from
Sep 26, 2024

Conversation

nevans
Copy link
Collaborator

@nevans nevans commented Sep 26, 2024

Previously, SequenceSet modification methods would raise a frozen error when it updated its internal data structure (currently implemented as an array of arrays), which was "can't modify frozen Array: [int, int]". This was unexpected, confusing, and misleading.

This changes the SequenceSet modification methods to raise the expected FrozenError prior to attempting to modify the internal data structure.

Previously, SequenceSet modification methods would raise a frozen error
when it updated its internal data structure (currently implemented as an
array of arrays), which was "can't modify frozen Array: [int, int]".
This was unexpected, confusing, and misleading.

This changes the SequenceSet modification methods to raise the expected
FrozenError _prior_ to attempting to modify the internal data structure.
@nevans nevans merged commit cf7e62c into ruby:master Sep 26, 2024
9 checks passed
@nevans nevans deleted the nicer-seqset-frozen-error branch September 26, 2024 14:40
nevans added a commit that referenced this pull request Oct 13, 2024
…zen-error

🥅 Improve SequenceSet frozen errors [backport: #331]
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.

1 participant