swiftlang / swiftlang/swift-experimental-string-processing
`contains<C>(_:)` does not behave as expected
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 308
- Forks
- 52
- Avg merge
- 12h 45m
- Merged PRs (30d)
- 2
Description
Because this is defined on Collection it is available to all Collection types, not just String. The behavior on other types is odd at best. It isn't even predictable when working with a Set. I think it should either be fixed to behave as expected, or narrowed down to just work on String?
Attached is an example playground to experiment with which demonstrates the issue.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the attached Contains.playground.zip and compare contains(_:) behavior across Collection types, especially Set. The issue does not choose between correcting the behavior and restricting the API to String, so completion requires an agreed direction, predictable behavior, and tests for the chosen scope.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100