Skip to content

Commit eba7550

Browse files
committed
Set Foundation.Data.SubSequence to be RangeReplaceable
RangeReplaceableCollection.SubSequence should be a RangeReplaceableCollection. Data implements RangeReplaceableCollection, but sets SubSequence to MutableRandomAccessSlice that is not a RangeReplaceableCollection. This commit changes Foundation.Data.SubSequence to MutableRangeReplaceableRandomAccessSlice. Fixes rdar://problem/28330713.
1 parent f59b83a commit eba7550

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

stdlib/public/SDK/Foundation/Data.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -613,9 +613,9 @@ public struct Data : ReferenceConvertible, Equatable, Hashable, RandomAccessColl
613613
}
614614
}
615615

616-
public subscript(bounds: Range<Index>) -> MutableRandomAccessSlice<Data> {
616+
public subscript(bounds: Range<Index>) -> MutableRangeReplaceableRandomAccessSlice<Data> {
617617
get {
618-
return MutableRandomAccessSlice(base: self, bounds: bounds)
618+
return MutableRangeReplaceableRandomAccessSlice(base: self, bounds: bounds)
619619
}
620620
set {
621621
replaceSubrange(bounds, with: newValue.base)

0 commit comments

Comments
 (0)