Skip to content

Conversation

glessard
Copy link
Contributor

This adds a precondition that will trap if the slice on the right hand side of an assignment contains any index that is absent in the slice on the left hand side of the assignment.

@glessard glessard marked this pull request as draft August 17, 2021 18:15
@glessard
Copy link
Contributor Author

glessard commented Aug 17, 2021

This is in keeping with usual standard library behaviour, but may still be worth discussing. The current behaviour (in 1.0.1) is to ignore indices that are not present in the slice in the left hand side of the assignment.

Do we want to trap in this case? If we want this, the tests need an update.

Note that we could also require the index sets to be equal on both sides of the assignment.

@glessard glessard requested a review from natecook1000 August 25, 2021 22:20
@jmschonfeld
Copy link

In the most recent review of RangeSet, this extension and conformance to MutableCollection have both been removed and the removals are reflected in the implementation at swiftlang/swift#69766

@glessard
Copy link
Contributor Author

glessard commented Jan 6, 2024

Thanks @jmschonfeld!

@glessard glessard closed this Jan 6, 2024
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