Skip to content

Commit 32184b4

Browse files
gribozavrDave Abrahams
authored andcommitted
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 b6898c7 commit 32184b4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Foundation/Data.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -652,9 +652,9 @@ public struct Data : ReferenceConvertible, Equatable, Hashable, RandomAccessColl
652652
}
653653
}
654654

655-
public subscript(bounds: Range<Index>) -> MutableRandomAccessSlice<Data> {
655+
public subscript(bounds: Range<Index>) -> MutableRangeReplaceableRandomAccessSlice<Data> {
656656
get {
657-
return MutableRandomAccessSlice(base: self, bounds: bounds)
657+
return MutableRangeReplaceableRandomAccessSlice(base: self, bounds: bounds)
658658
}
659659
set {
660660
replaceSubrange(bounds, with: newValue.base)

0 commit comments

Comments
 (0)