[SR-13492] Make StrideTo and StrideThrough conform to (RandomAccess)Collection
| Previous ID | SR-13492 |
| Radar | rdar://problem/68295652 |
| Original Reporter | CTMacUser (JIRA User) |
| Type | Improvement |
Additional Detail from JIRA
| Votes | 0 |
| Component/s | Standard Library |
| Labels | Improvement |
| Assignee | None |
| Priority | Medium |
md5: 6f660515240d7cc3dce35125895253ea
Issue Description:
These types only conform to Sequence, instead of Collection, due to SR-6474. Since that bug is now fixed, can we add the conformance now?
@swift-ci create
Comment by Kyle Macomber (JIRA)
This will require the ability to annotate protocol conformances with availability before we can land it.
Is there any way to push this? With swift-testing, this would be a welcome addition, as test arguments must be collections. With this conformance, we could pass strides directly:
@Test(arguments: stride(from: 9.0, through: 24, by: 2.5))
func testWithSizes(size: Double) { … }
As of Xcode 16 beta 4 this is an error.
This is more subtle than it seems at first, see https://github.com/swiftlang/swift/pull/13022 for some discussion.