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-13378] A range-set method overload needs to be moved. #55818

Open
swift-ci opened this issue Aug 10, 2020 · 2 comments
Open

[SR-13378] A range-set method overload needs to be moved. #55818

swift-ci opened this issue Aug 10, 2020 · 2 comments
Labels
improvement standard library Area: Standard library umbrella

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-13378
Radar rdar://problem/67361262
Original Reporter CTMacUser (JIRA User)
Type Improvement
Additional Detail from JIRA
Votes 0
Component/s Standard Library
Labels Improvement
Assignee None
Priority Medium

md5: 94b88b2bf327d37592f4ad93e4d67e87

Issue Description:

(This may be on the order of being a bug, at least spiritually.)

The issue is not on RangeSet itself, but the extension methods on Collection and its refined protocols. This is at [CollectionExtensions.swift|https://github.com/apple/swift-se0270-range-set/blob/master/Sources/SE0270_RangeSet/CollectionExtensions.swift.] There are two versions of the removeSubranges(_🙂 method, one on RangeReplacableCollection, and one for types that conform both to that and MutableCollection.

The second version is defined using MutableCollection as the main protocol and RangeReplaceableCollection as the conditional conformance. It should be the other way around. Mechanically, either order works. But spiritually, the method fits the philosophy of RRC and the MC condition is just an opportunity for optimization. From a non-spiritual view, it also messes up the documentation. MC methods never disrupt existing collection indices, but RRC methods always do; so it'll be confusing if an index-invalidating method appears in the documentation for MC without cause.

@theblixguy
Copy link
Collaborator

cc @natecook1000

@typesanitizer
Copy link

@swift-ci create

@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
improvement standard library Area: Standard library umbrella
Projects
None yet
Development

No branches or pull requests

3 participants