Navigation Menu

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

[SR-10030] Mutable collection ranged subscript docs should mention length requirement #52433

Open
natecook1000 opened this issue Mar 1, 2019 · 0 comments
Labels
standard library Area: Standard library umbrella task

Comments

@natecook1000
Copy link
Member

Previous ID SR-10030
Radar None
Original Reporter @natecook1000
Type Task
Additional Detail from JIRA
Votes 1
Component/s Standard Library
Labels Task
Assignee None
Priority Medium

md5: e0e60b8cc0a5ebc75058ed35d040a830

Issue Description:

Code using the ranged subscript on a MutableCollection instance that doesn't also conform to RangeReplaceableCollection must not change the length of the collection. This is a semantic requirement of MutableCollection that can't be enforced by the compiler, but is caught at runtime in the default implementation and in the standard library's implementing types.

The documentation for MutableCollection.subscript should include a note about this requirement, similar to the one in the MutableCollection protocol's discussion.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
standard library Area: Standard library umbrella task
Projects
None yet
Development

No branches or pull requests

1 participant