Unavailable instance method 'replaceSubrange(_:with:)' was used to satisfy a requirement of protocol 'RangeReplaceableCollection'
lolbigtime opened this issue · 0 comments
lolbigtime commented
extension ListTag: RandomAccessCollection, RangeReplaceableCollection {
public init() {
self.init(type: EndTag.self, tags: [])
}
public var startIndex: Int { tags.startIndex }
public var endIndex: Int { tags.endIndex }
public var count: Int { tags.count }
public func formIndex(after i: inout Int) {
tags.formIndex(after: &i)
}
public func formIndex(before i: inout Int) {
tags.formIndex(before: &i)
}
public func formIndex(_ i: inout Int, offsetBy distance: Int) {
tags.formIndex(&i, offsetBy: distance)
}
public subscript(position: Int) -> NBTTag {
get {
tags[position]
}
set {
tags[position] = newValue
}
}
public subscript(bounds: Range<Int>) -> ArraySlice<NBTTag> {
get {
tags[bounds]
}
set {
tags[bounds] = newValue
}
}
}
gives the Unavailable instance method 'replaceSubrange(_:with:)' was used to satisfy a requirement of protocol 'RangeReplaceableCollection' error in xcode 14.2