Skip to content

Conversation

@nevans
Copy link
Collaborator

@nevans nevans commented Apr 28, 2025

This maybe isn't actually documented very well (or at all...?) but most SequenceSet transform methods return a frozen result when self is frozen and a mutable result when self is mutable. Except limit which always returns a frozen result. And (before this commit) slice, which inconsistently returned with matching frozen status when the result wasn't empty, but always returned a frozen set when the result was empty.

(Adding these tests exposed a much more significant bug: SequenceSet#xor mutates the receiver crashes when the set is frozen: #457.)

@nevans nevans changed the base branch from sequence-set-slice-exclusive-range-ending-in-zero to master April 28, 2025 22:57
@nevans nevans added the bug Something isn't working label Apr 28, 2025
This maybe isn't actually documented very well (or at all...) but most
SequenceSet transform methods return a frozen result when +self+ is
frozen and a mutable result when +self+ is mutable.  Except +limit+
which always returns a frozen result.  And (before this commit) +slice+,
which inconsistently returned with matching frozen status when the
result wasn't empty, but always returned a frozen set when the result
_was_ empty.

Adding these tests exposed a much more significant bug:
`SequenceSet#xor` mutates the reciever.
@nevans nevans force-pushed the sequence_set/fix-slice-inconsistent-frozen branch from 4918584 to 1e2b599 Compare April 29, 2025 02:45
@nevans nevans merged commit ac7f7b9 into master Apr 29, 2025
37 checks passed
@nevans nevans deleted the sequence_set/fix-slice-inconsistent-frozen branch April 29, 2025 02:49
@nevans nevans added the sequence-set Any code the IMAP `sequence-set` data type or grammar rule, especially the SequenceSet class. label Dec 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working sequence-set Any code the IMAP `sequence-set` data type or grammar rule, especially the SequenceSet class.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants