From 32d1372f62eb69c4399e35477784e7dcb08f9e2e Mon Sep 17 00:00:00 2001 From: Jeremy Schonfeld Date: Thu, 9 Nov 2023 15:31:42 -0800 Subject: [PATCH 01/17] Adds RangeSet/DiscontiguousSlice to the stdlib --- stdlib/public/core/CMakeLists.txt | 3 + stdlib/public/core/CollectionAlgorithms.swift | 78 ++- stdlib/public/core/DiscontiguousSlice.swift | 482 +++++++++++++++++ stdlib/public/core/GroupInfo.json | 3 + stdlib/public/core/MutableCollection.swift | 44 +- .../core/RangeReplaceableCollection.swift | 93 +++- stdlib/public/core/RangeSet.swift | 408 ++++++++++++++ stdlib/public/core/RangeSetRanges.swift | 313 +++++++++++ test/Constraints/members.swift | 1 + validation-test/stdlib/RangeSet.swift | 500 ++++++++++++++++++ 10 files changed, 1922 insertions(+), 3 deletions(-) create mode 100644 stdlib/public/core/DiscontiguousSlice.swift create mode 100644 stdlib/public/core/RangeSet.swift create mode 100644 stdlib/public/core/RangeSetRanges.swift create mode 100644 validation-test/stdlib/RangeSet.swift diff --git a/stdlib/public/core/CMakeLists.txt b/stdlib/public/core/CMakeLists.txt index eac774930b12e..bd171b5c26bc0 100644 --- a/stdlib/public/core/CMakeLists.txt +++ b/stdlib/public/core/CMakeLists.txt @@ -71,6 +71,7 @@ split_embedded_sources( NORMAL DictionaryCasting.swift NORMAL DictionaryStorage.swift NORMAL DictionaryVariant.swift + NORMAL DiscontiguousSlice.swift NORMAL DropWhile.swift NORMAL Dump.swift EMBEDDED EmptyCollection.swift @@ -129,6 +130,8 @@ split_embedded_sources( EMBEDDED RandomAccessCollection.swift EMBEDDED Range.swift EMBEDDED RangeReplaceableCollection.swift + NORMAL RangeSet.swift + NORMAL RangeSetRanges.swift NORMAL ReflectionMirror.swift EMBEDDED Repeat.swift NORMAL REPL.swift diff --git a/stdlib/public/core/CollectionAlgorithms.swift b/stdlib/public/core/CollectionAlgorithms.swift index 350f2ed2e2c16..b70404f9c5e3a 100644 --- a/stdlib/public/core/CollectionAlgorithms.swift +++ b/stdlib/public/core/CollectionAlgorithms.swift @@ -2,7 +2,7 @@ // // This source file is part of the Swift.org open source project // -// Copyright (c) 2014 - 2020 Apple Inc. and the Swift project authors +// Copyright (c) 2014 - 2023 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/LICENSE.txt for license information @@ -209,6 +209,82 @@ extension BidirectionalCollection where Element: Equatable { } } +//===----------------------------------------------------------------------===// +// indices(where:) / indices(of:) +//===----------------------------------------------------------------------===// + +extension Collection { + /// Returns the indices of all the elements that match the given predicate. + /// + /// For example, you can use this method to find all the places that a + /// vowel occurs in a string. + /// + /// let str = "Fresh cheese in a breeze" + /// let vowels: Set = ["a", "e", "i", "o", "u"] + /// let allTheVowels = str.indices(where: { vowels.contains($0) }) + /// // str[allTheVowels].count == 9 + /// + /// - Parameter predicate: A closure that takes an element as its argument + /// and returns a Boolean value that indicates whether the passed element + /// represents a match. + /// - Returns: A set of the indices of the elements for which `predicate` + /// returns `true`. + /// + /// - Complexity: O(*n*), where *n* is the length of the collection. + @available(SwiftStdlib 5.11, *) + public func indices(where predicate: (Element) throws -> Bool) rethrows + -> RangeSet + { + if isEmpty { return RangeSet() } + + var result: [Range] = [] + var i = startIndex + var start: Index? = nil + while i < endIndex { + if try predicate(self[i]) { + if start == nil { + start = i + } + } else { + if let oldStart = start { + result.append(oldStart ..< i) + start = nil + } + } + formIndex(after: &i) + } + + if let start { + result.append(start ..< endIndex) + } + + return RangeSet(_orderedRanges: result) + } +} + +extension Collection where Element: Equatable { + /// Returns the indices of all the elements that are equal to the given + /// element. + /// + /// For example, you can use this method to find all the places that a + /// particular letter occurs in a string. + /// + /// let str = "Fresh cheese in a breeze" + /// let allTheEs = str.indices(of: "e") + /// // str[allTheEs].count == 7 + /// + /// - Parameter element: An element to look for in the collection. + /// - Returns: A set of the indices of the elements that are equal to + /// `element`. + /// + /// - Complexity: O(*n*), where *n* is the length of the collection. + @available(SwiftStdlib 5.11, *) + @inlinable + public func indices(of element: Element) -> RangeSet { + indices(where: { $0 == element }) + } +} + //===----------------------------------------------------------------------===// // partition(by:) //===----------------------------------------------------------------------===// diff --git a/stdlib/public/core/DiscontiguousSlice.swift b/stdlib/public/core/DiscontiguousSlice.swift new file mode 100644 index 0000000000000..0c089aad0037e --- /dev/null +++ b/stdlib/public/core/DiscontiguousSlice.swift @@ -0,0 +1,482 @@ +//===--- DiscontiguousSlice.swift -----------------------------*- swift -*-===// +// +// This source file is part of the Swift.org open source project +// +// Copyright (c) 2020 - 2023 Apple Inc. and the Swift project authors +// Licensed under Apache License v2.0 with Runtime Library Exception +// +// See https://swift.org/LICENSE.txt for license information +// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors +// +//===----------------------------------------------------------------------===// + +/// A collection wrapper that provides access to the elements of a collection, +/// indexed by a set of indices. +@available(SwiftStdlib 5.11, *) +@frozen +public struct DiscontiguousSlice { + @usableFromInline + internal var _base: Base + + /// The set of subranges that are available through this discontiguous slice. + public let subranges: RangeSet + + /// The collection that the indexed collection wraps. + @inlinable + public var base: Base { + return _base + } + + @inlinable + internal init(_base: Base, subranges: RangeSet) { + self._base = _base + self.subranges = subranges + } +} + +@available(SwiftStdlib 5.11, *) +extension DiscontiguousSlice: Sendable +where Base: Sendable, Base.Index: Sendable {} + +@available(SwiftStdlib 5.11, *) +extension DiscontiguousSlice: Equatable where Base.Element: Equatable { + @inlinable + public static func ==(lhs: Self, rhs: Self) -> Bool { + lhs.elementsEqual(rhs) + } +} + +@available(SwiftStdlib 5.11, *) +extension DiscontiguousSlice: Hashable where Base.Element: Hashable { + @inlinable + public func hash(into hasher: inout Hasher) { + var count = 0 + for element in self { + hasher.combine(element) + count += 1 + } + hasher.combine(count) // discriminator + } +} + +@available(SwiftStdlib 5.11, *) +extension DiscontiguousSlice: CustomStringConvertible { + public var description: String { + _makeCollectionDescription() + } +} + +@available(SwiftStdlib 5.11, *) +extension DiscontiguousSlice { + /// A position in a `DiscontiguousSlice`. + @frozen + public struct Index: Comparable { + /// The index of the range that contains `base`. + @usableFromInline + internal let _rangeOffset: Int + + /// The position of this index in the base collection. + public let base: Base.Index + + @inlinable + internal init(_rangeOffset: Int, base: Base.Index) { + self._rangeOffset = _rangeOffset + self.base = base + } + } +} + +@available(SwiftStdlib 5.11, *) +extension DiscontiguousSlice.Index: Equatable { + @inlinable + public static func == (left: Self, right: Self) -> Bool { + left.base == right.base + } +} + +@available(SwiftStdlib 5.11, *) +extension DiscontiguousSlice.Index: Hashable where Base.Index: Hashable { + @inlinable + public func hash(into hasher: inout Hasher) { + hasher.combine(base) + } +} + +@available(SwiftStdlib 5.11, *) +extension DiscontiguousSlice.Index: Comparable { + @inlinable + public static func < (left: Self, right: Self) -> Bool { + left.base < right.base + } +} + +@available(SwiftStdlib 5.11, *) +extension DiscontiguousSlice.Index: CustomStringConvertible { + public var description: String { + var d = "" + debugPrint(base, terminator: "", to: &d) + d += " (rangeOffset: \(_rangeOffset))" + return d + } +} + +@available(SwiftStdlib 5.11, *) +extension DiscontiguousSlice.Index: Sendable where Base.Index: Sendable {} + +@available(SwiftStdlib 5.11, *) +extension DiscontiguousSlice: Sequence { + public typealias Element = Base.Element + public typealias Iterator = IndexingIterator + + @inlinable + public func _customContainsEquatableElement(_ element: Element) -> Bool? { + _customIndexOfEquatableElement(element).map { $0 != nil } + } + + @inlinable + public __consuming func _copyToContiguousArray() -> ContiguousArray { + var result: ContiguousArray = [] + for range in subranges.ranges { + result.append(contentsOf: base[range]) + } + return result + } +} + +@available(SwiftStdlib 5.11, *) +extension DiscontiguousSlice: Collection { + public typealias SubSequence = Self + public typealias Indices = DefaultIndices + + @inlinable + public var startIndex: Index { + subranges.isEmpty + ? endIndex + : Index(_rangeOffset: 0, base: subranges.ranges[0].lowerBound) + } + + @inlinable + public var endIndex: Index { + Index(_rangeOffset: subranges.ranges.endIndex, base: _base.endIndex) + } + + @inlinable + public var count: Int { + var c = 0 + for range in subranges.ranges { + c += base[range].count + } + return c + } + + @inlinable + public var isEmpty: Bool { + subranges.isEmpty + } + + @inlinable + public func distance(from start: Index, to end: Index) -> Int { + let ranges = subranges.ranges[start._rangeOffset ... end._rangeOffset] + guard ranges.count > 1 else { + return _base[ranges[0]].distance(from: start.base, to: end.base) + } + let firstRange = ranges.first! + let lastRange = ranges.last! + let head = _base[firstRange].distance( + from: start.base, to: firstRange.upperBound) + let tail = _base[lastRange].distance( + from: lastRange.lowerBound, to: end.base) + let middle = ranges[1 ..< (ranges.endIndex - 1)].reduce(0) { + $0 + _base[$1].count + } + return head + middle + tail + } + + @inlinable + public func index(after i: Index) -> Index { + // Note: index validation performed by the underlying collections only + let currentRange = subranges.ranges[i._rangeOffset] + let nextIndex = _base[currentRange].index(after: i.base) + if nextIndex < currentRange.upperBound { + return Index(_rangeOffset: i._rangeOffset, base: nextIndex) + } + + let nextOffset = i._rangeOffset + 1 + guard nextOffset < subranges.ranges.endIndex else { + return endIndex + } + + return Index( + _rangeOffset: nextOffset, base: subranges.ranges[nextOffset].lowerBound) + } + + @inlinable + public subscript(i: Index) -> Base.Element { + // Note: index validation performed by the base collection only + _base[subranges.ranges[i._rangeOffset]][i.base] + } + + @inlinable + public subscript(bounds: Range) -> DiscontiguousSlice { + let baseBounds = bounds.lowerBound.base ..< bounds.upperBound.base + let baseSlice = base[baseBounds] + let baseAdjustedBounds = baseSlice.startIndex ..< baseSlice.endIndex + let subset = subranges.intersection(RangeSet(baseAdjustedBounds)) + return DiscontiguousSlice(_base: base, subranges: subset) + } + + @usableFromInline + internal func _index(of baseIndex: Base.Index) -> Index? { + let rangeOffset = subranges.ranges + ._partitioningIndex { $0.upperBound >= baseIndex } + let subrange = subranges.ranges[rangeOffset] + guard subrange.contains(baseIndex) else { + return nil + } + return Index(_rangeOffset: rangeOffset, base: baseIndex) + } + + @inlinable + public func _customIndexOfEquatableElement(_ element: Element) -> Index?? { + var definite = true + for (i, range) in subranges.ranges.enumerated() { + guard let baseResult = _base[range] + ._customIndexOfEquatableElement(element) else { + definite = false + continue + } + guard let baseIndex = baseResult else { + continue + } + return Index(_rangeOffset: i, base: baseIndex) + } + if definite { + return .some(nil) + } else { + return nil + } + } + + @inlinable + public func _customLastIndexOfEquatableElement(_ element: Element) -> Index?? { + var definite = true + for (i, range) in subranges.ranges.enumerated().reversed() { + guard let baseResult = _base[range] + ._customLastIndexOfEquatableElement(element) else { + definite = false + continue + } + guard let baseIndex = baseResult else { + continue + } + return Index(_rangeOffset: i, base: baseIndex) + } + if definite { + return .some(nil) + } else { + return nil + } + } + + @inlinable + public func _failEarlyRangeCheck(_ index: Index, bounds: Range) { + let baseBounds = bounds.lowerBound.base ..< bounds.upperBound.base + let offsetBounds = bounds.lowerBound._rangeOffset ..< + bounds.upperBound._rangeOffset + _base._failEarlyRangeCheck(index.base, bounds: baseBounds) + _precondition(offsetBounds.contains(index._rangeOffset)) + if index._rangeOffset == endIndex._rangeOffset { + _precondition(index.base == _base.endIndex) + } else { + _precondition(subranges.ranges[index._rangeOffset].contains(index.base)) + } + } + + @inlinable + public func _failEarlyRangeCheck(_ index: Index, bounds: ClosedRange) { + let baseBounds = bounds.lowerBound.base ... bounds.upperBound.base + let offsetBounds = bounds.lowerBound._rangeOffset ... + bounds.upperBound._rangeOffset + _base._failEarlyRangeCheck(index.base, bounds: baseBounds) + _precondition(offsetBounds.contains(index._rangeOffset)) + if index._rangeOffset == endIndex._rangeOffset { + _precondition(index.base == _base.endIndex) + } else { + _precondition(subranges.ranges[index._rangeOffset].contains(index.base)) + } + } + + @inlinable + public func _failEarlyRangeCheck(_ range: Range, bounds: Range) { + let baseBounds = bounds.lowerBound.base ..< bounds.upperBound.base + let baseRange = range.lowerBound.base ..< range.upperBound.base + let offsetBounds = bounds.lowerBound._rangeOffset ..< + bounds.upperBound._rangeOffset + let offsetRange = range.lowerBound._rangeOffset ..< + range.upperBound._rangeOffset + + _base._failEarlyRangeCheck(baseRange, bounds: baseBounds) + _precondition(offsetBounds.contains(offsetRange.lowerBound)) + _precondition(offsetRange.upperBound <= offsetBounds.upperBound) + + if offsetRange.lowerBound == endIndex._rangeOffset { + _precondition(baseRange.lowerBound == _base.endIndex) + } else { + _precondition( + subranges.ranges[offsetRange.lowerBound].contains(baseRange.lowerBound)) + } + + if offsetRange.upperBound == endIndex._rangeOffset { + _precondition(baseRange.upperBound == _base.endIndex) + } else { + _precondition( + subranges.ranges[offsetRange.upperBound].contains(baseRange.upperBound)) + } + } +} + +@available(SwiftStdlib 5.11, *) +extension DiscontiguousSlice: BidirectionalCollection + where Base: BidirectionalCollection +{ + @inlinable + public func index(before i: Index) -> Index { + _precondition(i > startIndex, "Can't move index before startIndex") + + if i.base == base.endIndex || + i.base == subranges.ranges[i._rangeOffset].lowerBound { + // Go to next subrange + let nextOffset = i._rangeOffset - 1 + let nextRange = subranges.ranges[nextOffset] + let nextBase = base[nextRange].index(before: nextRange.upperBound) + return Index(_rangeOffset: nextOffset, base: nextBase) + } else { + // Move within current subrange + let currentRange = subranges.ranges[i._rangeOffset] + let nextBase = base[currentRange].index(before: i.base) + return Index(_rangeOffset: i._rangeOffset, base: nextBase) + } + } +} + +@available(SwiftStdlib 5.11, *) +extension DiscontiguousSlice where Base: MutableCollection { + /// Accesses the element at the specified position. + /// + /// For example, you can replace an element of an array by using its + /// subscript. + /// + /// var streets = ["Adams", "Bryant", "Channing", "Douglas", "Evarts"] + /// streets[1] = "Butler" + /// print(streets[1]) + /// // Prints "Butler" + /// + /// You can subscript a collection with any valid index other than the + /// collection's end index. The end index refers to the position one + /// past the last element of a collection, so it doesn't correspond with an + /// element. + /// + /// - Parameter position: The position of the element to access. `position` + /// must be a valid index of the collection that is not equal to the + /// `endIndex` property. + /// + /// - Complexity: O(1) + @inlinable + public subscript(i: Index) -> Base.Element { + get { + _base[subranges.ranges[i._rangeOffset]][i.base] + } + set { + _base[subranges.ranges[i._rangeOffset]][i.base] = newValue + } + } +} + +// MARK: Accessing DiscontiguousSlices + +extension Collection { + /// Accesses a view of this collection with the elements at the given + /// indices. + /// + /// - Parameter subranges: The indices of the elements to retrieve from this + /// collection. + /// - Returns: A collection of the elements at the positions in `subranges`. + /// + /// - Complexity: O(1) + @available(SwiftStdlib 5.11, *) + @inlinable + public subscript(subranges: RangeSet) -> DiscontiguousSlice { + DiscontiguousSlice(_base: self, subranges: subranges) + } +} + +extension MutableCollection { + /// Accesses a mutable view of this collection with the elements at the + /// given indices. + /// + /// - Parameter subranges: The ranges of the elements to retrieve from this + /// collection. + /// - Returns: A collection of the elements at the positions in `subranges`. + /// + /// - Complexity: O(1) to access the elements, O(*m*) to mutate the + /// elements at the positions in `subranges`, where *m* is the number of + /// elements indicated by `subranges`. + @available(SwiftStdlib 5.11, *) + public subscript(subranges: RangeSet) -> DiscontiguousSlice { + get { + DiscontiguousSlice(_base: self, subranges: subranges) + } + set { + var indexOfReplacement = newValue.startIndex + for range in subranges.ranges { + _debugPrecondition(!range.isEmpty, "Empty range in a range set") + + var indexToReplace = range.lowerBound + repeat { + _precondition( + indexOfReplacement < newValue.endIndex, + "Attempt to replace discontinuous slice with too few elements") + + self[indexToReplace] = newValue[indexOfReplacement] + self.formIndex(after: &indexToReplace) + newValue.formIndex(after: &indexOfReplacement) + } while indexToReplace < range.upperBound + } + + _precondition( + indexOfReplacement == newValue.endIndex, + "Attempt to replace discontinuous slice with too many elements") + } + } +} + + +extension Collection { + /// Returns a collection of the elements in this collection that are not + /// represented by the given range set. + /// + /// For example, this code sample finds the indices of all the vowel + /// characters in the string, and then retrieves a collection that omits + /// those characters. + /// + /// let str = "The rain in Spain stays mainly in the plain." + /// let vowels: Set = ["a", "e", "i", "o", "u"] + /// let vowelIndices = str.subranges(where: { vowels.contains($0) }) + /// + /// let disemvoweled = str.removingSubranges(vowelIndices) + /// print(String(disemvoweled)) + /// // Prints "Th rn n Spn stys mnly n th pln." + /// + /// - Parameter subranges: A range set representing the indices of the + /// elements to remove. + /// - Returns: A collection of the elements that are not in `subranges`. + /// + /// - Complexity: O(*n*), where *n* is the length of the collection. + @available(SwiftStdlib 5.11, *) + public func removingSubranges( + _ subranges: RangeSet + ) -> DiscontiguousSlice { + let inversion = subranges._inverted(within: self) + return self[inversion] + } +} diff --git a/stdlib/public/core/GroupInfo.json b/stdlib/public/core/GroupInfo.json index 2ec15e28a8669..9a9201950b762 100644 --- a/stdlib/public/core/GroupInfo.json +++ b/stdlib/public/core/GroupInfo.json @@ -76,6 +76,8 @@ "Sort.swift", "Range.swift", "ClosedRange.swift", + "RangeSet.swift", + "RangeSetRanges.swift", "CollectionOfOne.swift", "BridgingBuffer.swift", "Sequence.swift", @@ -102,6 +104,7 @@ "Filter.swift", "Reverse.swift", "Slice.swift", + "DiscontiguousSlice.swift", "DropWhile.swift", "PrefixWhile.swift", "LazyCollection.swift", diff --git a/stdlib/public/core/MutableCollection.swift b/stdlib/public/core/MutableCollection.swift index 08a4e0c3ad6e5..de28d06dd8349 100644 --- a/stdlib/public/core/MutableCollection.swift +++ b/stdlib/public/core/MutableCollection.swift @@ -2,7 +2,7 @@ // // This source file is part of the Swift.org open source project // -// Copyright (c) 2014 - 2020 Apple Inc. and the Swift project authors +// Copyright (c) 2014 - 2023 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/LICENSE.txt for license information @@ -364,6 +364,48 @@ extension MutableCollection where SubSequence == Slice { } } +//===----------------------------------------------------------------------===// +// moveSubranges(_:to:) +//===----------------------------------------------------------------------===// + +extension MutableCollection { + /// Moves the elements in the given subranges to just before the element at + /// the specified index. + /// + /// This example finds all the uppercase letters in the array and then + /// moves them to between `"i"` and `"j"`. + /// + /// var letters = Array("ABCdeFGhijkLMNOp") + /// let uppercaseRanges = letters.subranges(where: { $0.isUppercase }) + /// let rangeOfUppercase = letters.moveSubranges(uppercaseRanges, to: 10) + /// // String(letters) == "dehiABCFGLMNOjkp" + /// // rangeOfUppercase == 4..<13 + /// + /// - Parameters: + /// - subranges: The subranges of the elements to move. + /// - insertionPoint: The index to use as the destination of the elements. + /// - Returns: The new bounds of the moved elements. + /// + /// - Complexity: O(*n* log *n*) where *n* is the length of the collection. + @available(SwiftStdlib 5.11, *) + @discardableResult + public mutating func moveSubranges( + _ subranges: RangeSet, to insertionPoint: Index + ) -> Range { + let lowerCount = distance(from: startIndex, to: insertionPoint) + let upperCount = distance(from: insertionPoint, to: endIndex) + let start = _indexedStablePartition( + count: lowerCount, + range: startIndex.. = ["a", "e", "i", "o", "u"] + /// let vowelIndices = str.subranges(where: { vowels.contains($0) }) + /// + /// str.removeSubranges(vowelIndices) + /// // str == "Th rn n Spn stys mnly n th pln." + /// + /// - Parameter subranges: The indices of the elements to remove. + /// + /// - Complexity: O(*n*), where *n* is the length of the collection. + @available(SwiftStdlib 5.11, *) + public mutating func removeSubranges(_ subranges: RangeSet) { + guard !subranges.isEmpty else { + return + } + + let inversion = subranges._inverted(within: self) + var result = Self() + for range in inversion.ranges { + result.append(contentsOf: self[range]) + } + self = result + } +} + +extension MutableCollection where Self: RangeReplaceableCollection { + /// Removes the elements at the given indices. + /// + /// For example, this code sample finds the indices of all the negative + /// numbers in the array, and then removes those values. + /// + /// var numbers = [5, 7, -3, -8, 11, 2, -1, 6] + /// let negativeIndices = numbers.subranges(where: { $0 < 0 }) + /// + /// numbers.removeSubranges(negativeIndices) + /// // numbers == [5, 7, 11, 2, 6] + /// + /// - Parameter subranges: The indices of the elements to remove. + /// + /// - Complexity: O(*n*), where *n* is the length of the collection. + @available(SwiftStdlib 5.11, *) + public mutating func removeSubranges(_ subranges: RangeSet) { + guard let firstRange = subranges.ranges.first else { + return + } + + var endOfElementsToKeep = firstRange.lowerBound + var firstUnprocessed = firstRange.upperBound + + // This performs a half-stable partition based on the ranges in + // `indices`. At all times, the collection is divided into three + // regions: + // + // - `self[.. { + @usableFromInline + internal var _ranges: Ranges + + /// A collection of the ranges that make up the range set. + /// + /// The ranges that you access by using `ranges` never overlap, are never + /// empty, and are always in increasing order. + @inlinable + public var ranges: Ranges { + return _ranges + } + + /// Creates an empty range set. + @inlinable + public init() { + _ranges = Ranges() + } + + /// Creates a range set containing the given range. + /// + /// - Parameter range: The range to use for the new range set. + @inlinable + public init(_ range: Range) { + if !range.isEmpty { + self._ranges = Ranges(_range: range) + } else { + self._ranges = Ranges() + } + } + + /// Creates a range set containing the values in the given ranges. + /// + /// Any empty ranges in `ranges` are ignored, and non-empty ranges are merged + /// to eliminate any overlaps. As such, the `ranges` collection in the + /// resulting range set may not be equivalent to the sequence of ranges + /// passed to this initializer. + /// + /// - Parameter ranges: The ranges to use for the new range set. + @inlinable + public init(_ ranges: S) where S.Element == Range { + self.init() + for range in ranges { + insert(contentsOf: range) + } + } + + @inlinable + internal init(_ranges: Ranges) { + self._ranges = _ranges + } + + /// Checks the invariants of `_ranges`. + /// + /// The ranges stored by a range set are never empty, never overlap, + /// and are always stored in ascending order when comparing their lower + /// or upper bounds. In addition to not overlapping, no two consecutive + /// ranges share an upper and lower bound — `[0..<5, 5..<10]` is ill-formed, + /// and would instead be represented as `[0..<10]`. + @inlinable + internal func _checkInvariants() { + for (a, b) in zip(_ranges, _ranges.dropFirst()) { + _debugPrecondition(!a.isEmpty && !b.isEmpty, "Empty range in range set") + _debugPrecondition( + a.upperBound < b.lowerBound, + "Out of order/overlapping ranges in range set") + } + } + + /// Creates a new range set from `ranges`, which satisfies the range set + /// invariants. + @inlinable + internal init(_orderedRanges ranges: [Range]) { + switch ranges.count { + case 0: self._ranges = Ranges() + case 1: self._ranges = Ranges(_range: ranges[0]) + default: self._ranges = Ranges(_ranges: ranges) + } + _checkInvariants() + } + + /// A Boolean value indicating whether the range set is empty. + @inlinable + public var isEmpty: Bool { + _ranges.isEmpty + } + + /// Returns a Boolean value indicating whether the given value is + /// contained by the ranges in the range set. + /// + /// - Parameter value: The value to look for in the range set. + /// - Returns: `true` if `value` is contained by a range in the range set; + /// otherwise, `false`. + /// + /// - Complexity: O(log *n*), where *n* is the number of ranges in the + /// range set. + @inlinable + public func contains(_ value: Bound) -> Bool { + _ranges._contains(value) + } + + /// Inserts the given range into the range set. + /// + /// - Parameter range: The range to insert into the set. + /// + /// - Complexity: O(*n*), where *n* is the number of ranges in the range + /// set. + @inlinable + public mutating func insert(contentsOf range: Range) { + if range.isEmpty { return } + _ranges._insert(contentsOf: range) + } + + /// Removes the given range from the range set. + /// + /// - Parameter range: The range to remove from the set. + /// + /// - Complexity: O(*n*), where *n* is the number of ranges in the range + /// set. + @inlinable + public mutating func remove(contentsOf range: Range) { + if range.isEmpty { return } + _ranges._remove(contentsOf: range) + } +} + +@available(SwiftStdlib 5.11, *) +extension RangeSet: Equatable { + @inlinable + public static func == (left: Self, right: Self) -> Bool { + left._ranges == right._ranges + } +} + +@available(SwiftStdlib 5.11, *) +extension RangeSet: Hashable where Bound: Hashable { + @inlinable + public func hash(into hasher: inout Hasher) { + hasher.combine(self._ranges) + } +} + +@available(SwiftStdlib 5.11, *) +extension RangeSet: Sendable where Bound: Sendable {} + +// MARK: - Collection APIs + +@available(SwiftStdlib 5.11, *) +extension RangeSet { + /// Creates a new range set containing ranges that contain only the + /// specified indices in the given collection. + /// + /// - Parameters: + /// - index: The index to include in the range set. `index` must be a + /// valid index of `collection` that isn't the collection's `endIndex`. + /// - collection: The collection that contains `index`. + @inlinable + public init(_ indices: S, within collection: C) + where S: Sequence, C: Collection, S.Element == C.Index, C.Index == Bound + { + self.init() + for i in indices { + self.insert(i, within: collection) + } + } + + /// Inserts a range that contains only the specified index into the range + /// set. + /// + /// - Parameters: + /// - index: The index to insert into the range set. `index` must be a + /// valid index of `collection` that isn't the collection's `endIndex`. + /// - collection: The collection that contains `index`. + /// + /// - Complexity: O(*n*), where *n* is the number of ranges in the range + /// set. + @inlinable + public mutating func insert(_ index: Bound, within collection: C) + where C: Collection, C.Index == Bound + { + insert(contentsOf: index ..< collection.index(after: index)) + } + + /// Removes the range that contains only the specified index from the range + /// set. + /// + /// - Parameters: + /// - index: The index to remove from the range set. `index` must be a + /// valid index of `collection` that isn't the collection's `endIndex`. + /// - collection: The collection that contains `index`. + /// + /// - Complexity: O(*n*), where *n* is the number of ranges in the range + /// set. + @inlinable + public mutating func remove(_ index: Bound, within collection: C) + where C: Collection, C.Index == Bound + { + remove(contentsOf: index ..< collection.index(after: index)) + } + + /// Returns a range set that represents all the elements in the given + /// collection that aren't represented by this range set. + /// + /// - Parameter collection: The collection that the range set is relative + /// to. + /// - Returns: A new range set that represents the elements in `collection` + /// that aren't represented by this range set. + /// + /// - Complexity: O(*n*), where *n* is the number of ranges in the range + /// set. + @inlinable + internal func _inverted(within collection: C) -> RangeSet + where C: Collection, C.Index == Bound + { + return RangeSet(_ranges: _ranges._gaps( + boundedBy: collection.startIndex ..< collection.endIndex)) + } +} + +// MARK: - SetAlgebra + +// These methods only depend on the ranges that comprise the range set, so +// we can provide them even when we can't provide `SetAlgebra` conformance. +@available(SwiftStdlib 5.11, *) +extension RangeSet { + /// Adds the contents of the given range set to this range set. + /// + /// - Parameter other: A range set to merge with this one. + @inlinable + public mutating func formUnion(_ other: __owned RangeSet) { + for range in other._ranges { + insert(contentsOf: range) + } + } + + /// Removes the contents of this range set that aren't also in the given + /// range set. + /// + /// - Parameter other: A range set to intersect with. + @inlinable + public mutating func formIntersection(_ other: RangeSet) { + self = self.intersection(other) + } + + /// Removes the contents of this range set that are also in the given set + /// and adds the contents of the given set that are not already in this + /// range set. + /// + /// - Parameter other: A range set to perform a symmetric difference against. + @inlinable + public mutating func formSymmetricDifference( + _ other: __owned RangeSet + ) { + self = self.symmetricDifference(other) + } + + /// Removes the contents of the given range set from this range set. + /// + /// - Parameter other: A range set to subtract from this one. + @inlinable + public mutating func subtract(_ other: RangeSet) { + for range in other._ranges { + remove(contentsOf: range) + } + } + + /// Returns a new range set containing the contents of both this set and the + /// given set. + /// + /// - Parameter other: The range set to merge with this one. + /// - Returns: A new range set. + @inlinable + public __consuming func union( + _ other: __owned RangeSet + ) -> RangeSet { + var result = self + result.formUnion(other) + return result + } + + /// Returns a new range set containing the contents of both this set and the + /// given set. + /// + /// - Parameter other: The range set to merge with this one. + /// - Returns: A new range set. + @inlinable + public __consuming func intersection( + _ other: RangeSet + ) -> RangeSet { + return RangeSet(_ranges: _ranges._intersection(other._ranges)) + } + + /// Returns a new range set representing the values in this range set or the + /// given range set, but not both. + /// + /// - Parameter other: The range set to find a symmetric difference with. + /// - Returns: A new range set. + @inlinable + public __consuming func symmetricDifference( + _ other: __owned RangeSet + ) -> RangeSet { + return union(other).subtracting(intersection(other)) + } + + /// Returns a new set containing the contents of this range set that are not + /// also in the given range set. + /// + /// - Parameter other: The range set to subtract. + /// - Returns: A new range set. + @inlinable + public func subtracting(_ other: RangeSet) -> RangeSet { + var result = self + result.subtract(other) + return result + } + + /// Returns a Boolean value that indicates whether this range set is a + /// subset of the given set. + /// + /// - Parameter other: A range set to compare against. + /// - Returns: `true` if this range set is a subset of `other`; + /// otherwise, `false`. + @inlinable + public func isSubset(of other: RangeSet) -> Bool { + self.intersection(other) == self + } + + /// Returns a Boolean value that indicates whether this range set is a + /// superset of the given set. + /// + /// - Parameter other: A range set to compare against. + /// - Returns: `true` if this range set is a superset of `other`; + /// otherwise, `false`. + @inlinable + public func isSuperset(of other: RangeSet) -> Bool { + other.isSubset(of: self) + } + + /// Returns a Boolean value that indicates whether this range set is a + /// strict subset of the given set. + /// + /// - Parameter other: A range set to compare against. + /// - Returns: `true` if this range set is a strict subset of `other`; + /// otherwise, `false`. + @inlinable + public func isStrictSubset(of other: RangeSet) -> Bool { + self != other && isSubset(of: other) + } + + /// Returns a Boolean value that indicates whether this range set is a + /// strict superset of the given set. + /// + /// - Parameter other: A range set to compare against. + /// - Returns: `true` if this range set is a strict superset of `other`; + /// otherwise, `false`. + @inlinable + public func isStrictSuperset(of other: RangeSet) -> Bool { + other.isStrictSubset(of: self) + } + + /// Returns a Boolean value that indicates whether this range set set has + /// no members in common with the given set. + /// + /// - Parameter other: A range set to compare against. + /// - Returns: `true` if this range set has no elements in common with + /// `other`; otherwise, `false`. + @inlinable + public func isDisjoint(_ other: RangeSet) -> Bool { + self.intersection(other).isEmpty + } +} + +@available(SwiftStdlib 5.11, *) +extension RangeSet: CustomStringConvertible { + public var description: String { + return _ranges.description + } +} diff --git a/stdlib/public/core/RangeSetRanges.swift b/stdlib/public/core/RangeSetRanges.swift new file mode 100644 index 0000000000000..abf8b16423d0c --- /dev/null +++ b/stdlib/public/core/RangeSetRanges.swift @@ -0,0 +1,313 @@ +//===--- RangeSetRanges.swift ---------------------------------*- swift -*-===// +// +// This source file is part of the Swift.org open source project +// +// Copyright (c) 2023 Apple Inc. and the Swift project authors +// Licensed under Apache License v2.0 with Runtime Library Exception +// +// See https://swift.org/LICENSE.txt for license information +// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors +// +//===----------------------------------------------------------------------===// + +@available(SwiftStdlib 5.11, *) +extension RangeSet { + /// A collection of the ranges that make up a range set. + public struct Ranges { + internal var _storage: [Range] + + @usableFromInline + internal init() { + _storage = [] + } + + @usableFromInline + internal init(_range: Range) { + _storage = [_range] + } + + @usableFromInline + internal init(_ranges: [Range]) { + _storage = _ranges + } + + @usableFromInline + internal func _contains(_ bound: Bound) -> Bool { + let i = _storage._partitioningIndex { $0.upperBound > bound } + return i == _storage.endIndex ? false : _storage[i].lowerBound <= bound + } + + /// Returns a range indicating the existing ranges that `range` overlaps + /// with. + /// + /// For example, if `self` is `[0..<5, 10..<15, 20..<25, 30..<35]`, then: + /// + /// - `_indicesOfRange(12..<14) == 1..<2` + /// - `_indicesOfRange(12..<19) == 1..<2` + /// - `_indicesOfRange(17..<19) == 2..<2` + /// - `_indicesOfRange(12..<22) == 1..<3` + internal func _indicesOfRange( + _ range: Range, + in subranges: [Range], + includeAdjacent: Bool = true + ) -> Range { + guard subranges.count > 1 else { + if subranges.isEmpty { + return 0 ..< 0 + } else { + let subrange = subranges[0] + if range.upperBound < subrange.lowerBound { + return 0 ..< 0 + } else if range.lowerBound > subrange.upperBound { + return 1 ..< 1 + } else { + return 0 ..< 1 + } + } + } + + // The beginning index for the position of `range` is the first range + // with an upper bound larger than `range`'s lower bound. The range + // at this position may or may not overlap `range`. + let beginningIndex = subranges._partitioningIndex { + if includeAdjacent { + $0.upperBound >= range.lowerBound + } else { + $0.upperBound > range.lowerBound + } + } + + // The ending index for `range` is the first range with a lower bound + // greater than `range`'s upper bound. If this is the same as + // `beginningIndex`, than `range` doesn't overlap any of the existing + // ranges. If this is `ranges.endIndex`, then `range` overlaps the + // rest of the ranges. Otherwise, `range` overlaps one or + // more ranges in the set. + let endingIndex = subranges[beginningIndex...]._partitioningIndex { + if includeAdjacent { + $0.lowerBound > range.upperBound + } else { + $0.lowerBound >= range.upperBound + } + } + + return beginningIndex ..< endingIndex + } + + // Insert a non-empty range into the storage + @usableFromInline + internal mutating func _insert(contentsOf range: Range) { + let indices = _indicesOfRange(range, in: _storage) + if indices.isEmpty { + _storage.insert(range, at: indices.lowerBound) + } else { + let lower = Swift.min( + _storage[indices.lowerBound].lowerBound, range.lowerBound) + let upper = Swift.max( + _storage[indices.upperBound - 1].upperBound, range.upperBound) + _storage.replaceSubrange( + indices, with: CollectionOfOne(lower ..< upper)) + } + } + + // Remove a non-empty range from the storage + @usableFromInline + internal mutating func _remove(contentsOf range: Range) { + let indices = _indicesOfRange(range, in: _storage, includeAdjacent: false) + guard !indices.isEmpty else { + return + } + + let overlapsLowerBound = + range.lowerBound > _storage[indices.lowerBound].lowerBound + let overlapsUpperBound = + range.upperBound < _storage[indices.upperBound - 1].upperBound + + switch (overlapsLowerBound, overlapsUpperBound) { + case (false, false): + _storage.removeSubrange(indices) + case (false, true): + let newRange = + range.upperBound..<_storage[indices.upperBound - 1].upperBound + _storage.replaceSubrange(indices, with: CollectionOfOne(newRange)) + case (true, false): + let newRange = + _storage[indices.lowerBound].lowerBound ..< range.lowerBound + _storage.replaceSubrange(indices, with: CollectionOfOne(newRange)) + case (true, true): + _storage.replaceSubrange(indices, with: _Pair( + _storage[indices.lowerBound].lowerBound..) -> Self { + let indices = _indicesOfRange(bounds, in: _storage) + guard !indices.isEmpty else { + return Self(_range: bounds) + } + + var result: [Range] = [] + var low = bounds.lowerBound + for range in _storage[indices] { + let gapRange = low ..< range.lowerBound + if !gapRange.isEmpty { + result.append(gapRange) + } + low = range.upperBound + } + let finalRange = low ..< bounds.upperBound + if !finalRange.isEmpty { + result.append(finalRange) + } + let resultVal = Self(_ranges: result) + return resultVal + } + + @usableFromInline + internal func _intersection(_ other: Ranges) -> Ranges { + let left = self._storage + let right = other._storage + var otherRangeIndex = 0 + var result: [Range] = [] + + // Considering these two range sets: + // + // self = [0..<5, 9..<14] + // other = [1..<3, 4..<6, 8..<12] + // + // `self.intersection(other)` looks like this, where x's cover the + // ranges in `self`, y's cover the ranges in `other`, and z's cover the + // resulting ranges: + // + // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 + // xxxxxxxxxxxxxxxxxxx__ xxxxxxxxxxxxxxxxxxx__ + // yyyyyyy__ yyyyyyy__ yyyyyyyyyyyyyyy__ + // zzzzzzz__ zzz__ zzzzzzzzzzz__ + // + // The same, but for `other.intersection(self)`: + // + // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 + // xxxxxxx__ xxxxxxx__ xxxxxxxxxxxxxxx__ + // yyyyyyyyyyyyyyyyyyy__ yyyyyyyyyyyyyyyyyyy__ + // zzzzzzz__ zzz__ zzzzzzzzzzz__ + + for currentRange in left { + // Search forward in `right` until finding either an overlapping + // range or one that is strictly higher than this range. + while otherRangeIndex < right.endIndex && + right[otherRangeIndex].upperBound <= currentRange.lowerBound + { + otherRangeIndex += 1 + } + + // For each range in `right` that overlaps with the current range + // in `left`, append the intersection to the result. + while otherRangeIndex < right.endIndex && + right[otherRangeIndex].lowerBound < currentRange.upperBound + { + let overlap = right[otherRangeIndex].clamped(to: currentRange) + result.append(overlap) + + // If the range in `right` continues past the current range in + // `self`, it could overlap the next range in `self`, so break + // out of examining the current range. + guard + currentRange.upperBound > right[otherRangeIndex].upperBound + else { + break + } + otherRangeIndex += 1 + } + } + + return Ranges(_ranges: result) + } + } +} + +@available(SwiftStdlib 5.11, *) +extension RangeSet.Ranges : Sequence { + public typealias Element = Range + public typealias Iterator = IndexingIterator +} + +@available(SwiftStdlib 5.11, *) +extension RangeSet.Ranges : Collection { + public typealias Index = Int + public typealias Indices = Range + public typealias SubSequence = Slice + + @inlinable + public var startIndex: Index { + 0 + } + + public var endIndex: Index { + _storage.count + } + + @inlinable + public var count: Int { + self.endIndex + } + + public subscript(i: Index) -> Element { + _storage[i] + } +} + +@available(SwiftStdlib 5.11, *) +extension RangeSet.Ranges : RandomAccessCollection {} + +@available(SwiftStdlib 5.11, *) +extension RangeSet.Ranges: Equatable { + public static func == (left: Self, right: Self) -> Bool { + left._storage == right._storage + } +} + +@available(SwiftStdlib 5.11, *) +extension RangeSet.Ranges: Hashable where Bound: Hashable { + public func hash(into hasher: inout Hasher) { + hasher.combine(_storage.count) // Discriminator + hasher.combine(_storage) + } +} + +@available(SwiftStdlib 5.11, *) +extension RangeSet.Ranges: Sendable where Bound: Sendable {} + +@available(SwiftStdlib 5.11, *) +extension RangeSet.Ranges: CustomStringConvertible { + public var description: String { + _makeCollectionDescription() + } +} + +/// A collection of two elements, to avoid heap allocation when calling +/// `replaceSubrange` with just two elements. +internal struct _Pair: RandomAccessCollection { + internal var pair: (first: Element, second: Element) + + internal init(_ first: Element, _ second: Element) { + self.pair = (first, second) + } + + internal var startIndex: Int { 0 } + internal var endIndex: Int { 2 } + + internal subscript(position: Int) -> Element { + get { + switch position { + case 0: return pair.first + case 1: return pair.second + default: _preconditionFailure("Index is out of range") + } + } + } +} \ No newline at end of file diff --git a/test/Constraints/members.swift b/test/Constraints/members.swift index b3f2be5086455..e1ee63ffce684 100644 --- a/test/Constraints/members.swift +++ b/test/Constraints/members.swift @@ -634,6 +634,7 @@ func rdar_50467583_and_50909555() { // expected-note@-2 {{found candidate with type '(Int) -> Int'}} // expected-note@-3 {{found candidate with type '(Range) -> ArraySlice'}} // expected-note@-4 {{found candidate with type '((UnboundedRange_) -> ()) -> ArraySlice'}} + // expected-note@-5 {{found candidate with type '(RangeSet.Index>) -> DiscontiguousSlice<[Int]>' (aka '(RangeSet) -> DiscontiguousSlice>')}} } // rdar://problem/50909555 diff --git a/validation-test/stdlib/RangeSet.swift b/validation-test/stdlib/RangeSet.swift new file mode 100644 index 0000000000000..cce9c39645167 --- /dev/null +++ b/validation-test/stdlib/RangeSet.swift @@ -0,0 +1,500 @@ +// RUN: %target-run-simple-swift +// REQUIRES: executable_test + +import StdlibUnittest +import StdlibCollectionUnittest + +@available(SwiftStdlib 5.11, *) +extension RangeSet: ExpressibleByArrayLiteral { + public init(arrayLiteral elements: Range...) { + self.init(elements) + } +} + +extension Collection { + func every(_ n: Int) -> [Element] { + sequence(first: startIndex) { i in + self.index(i, offsetBy: n, limitedBy: self.endIndex) + }.map { self[$0] } + } +} + +let RangeSetTests = TestSuite("RangeSet") + +if #available(SwiftStdlib 5.11, *) { + let parent = -200..<200 + let source: RangeSet = [1..<5, 8..<10, 20..<22, 27..<29] + + let letterString = "ABCdefGHIjklMNOpqrStUvWxyz" + let lowercaseLetters = letterString.filter { $0.isLowercase } + let uppercaseLetters = letterString.filter { $0.isUppercase } + + func buildRandomRangeSet(iterations: Int = 100) -> RangeSet { + var set = RangeSet() + for _ in 0..<100 { + var (a, b) = (Int.random(in: -100...100), Int.random(in: -100...100)) + if (a > b) { swap(&a, &b) } + if Double.random(in: 0..<1) > 0.3 { + set.insert(contentsOf: a.., + _ s2: RangeSet + ) -> RangeSet { + let set1 = Set(parent.indices[s1]) + let set2 = Set(parent.indices[s2]) + return RangeSet(set1.intersection(set2), within: parent) + } + + do { + // Simple test + let set1: RangeSet = [0..<5, 9..<14] + let set2: RangeSet = [1..<3, 4..<6, 8..<12] + let intersection: RangeSet = [1..<3, 4..<5, 9..<12] + expectEqual(set1.intersection(set2), intersection) + expectEqual(set2.intersection(set1), intersection) + } + + do { + // Test with upper bound / lower bound equality + let set1: RangeSet = [10..<20, 30..<40] + let set2: RangeSet = [15..<30, 40..<50] + let intersection: RangeSet = [15..<20] + expectEqual(set1.intersection(set2), intersection) + expectEqual(set2.intersection(set1), intersection) + } + + for _ in 0..<100 { + let set1 = buildRandomRangeSet() + let set2 = buildRandomRangeSet() + + let rangeSetIntersection = set1.intersection(set2) + let stdlibSetIntersection = intersectionViaSet(set1, set2) + expectEqual(rangeSetIntersection, stdlibSetIntersection) + } + } + + RangeSetTests.test("symmetricDifference") { + func symmetricDifferenceViaSet( + _ s1: RangeSet, + _ s2: RangeSet + ) -> RangeSet { + let set1 = Set(parent.indices[s1]) + let set2 = Set(parent.indices[s2]) + return RangeSet(set1.symmetricDifference(set2), within: parent) + } + + do { + // Simple test + let set1: RangeSet = [0..<5, 9..<14] + let set2: RangeSet = [1..<3, 4..<6, 8..<12] + let difference: RangeSet = [0..<1, 3..<4, 5..<6, 8..<9, 12..<14] + expectEqual(set1.symmetricDifference(set2), difference) + expectEqual(set2.symmetricDifference(set1), difference) + } + + do { + // Test with upper bound / lower bound equality + let set1: RangeSet = [10..<20, 30..<40] + let set2: RangeSet = [15..<30, 40..<50] + let difference: RangeSet = [10..<15, 20..<50] + expectEqual(set1.symmetricDifference(set2), difference) + expectEqual(set2.symmetricDifference(set1), difference) + } + + for _ in 0..<100 { + let set1 = buildRandomRangeSet() + let set2 = buildRandomRangeSet() + + let rangeSetDifference = set1.symmetricDifference(set2) + let stdlibSetDifference = symmetricDifferenceViaSet(set1, set2) + expectEqual(rangeSetDifference, stdlibSetDifference) + } + } + + RangeSetTests.test("isDisjoint") { + func isDisjointViaSet(_ s1: RangeSet, _ s2: RangeSet) -> Bool { + let set1 = Set(parent.indices[s1]) + let set2 = Set(parent.indices[s2]) + return set1.isDisjoint(with: set2) + } + + do { + // Simple test + let set1: RangeSet = [0..<5, 9..<14] + let set2: RangeSet = [1..<3, 4..<6, 8..<12] + let set3: RangeSet = [6..<9, 14..<20] + expectFalse(set1.isDisjoint(set2)) + expectFalse(set2.isDisjoint(set1)) + expectTrue(set1.isDisjoint(set3)) + expectTrue(set3.isDisjoint(set1)) + } + + for _ in 0..<100 { + let set1 = buildRandomRangeSet() + let set2 = buildRandomRangeSet() + + let rangeSetDisjoint = set1.isDisjoint(set2) + let stdlibSetDisjoint = isDisjointViaSet(set1, set2) + expectEqual(rangeSetDisjoint, stdlibSetDisjoint) + } + } + + RangeSetTests.test("indices(of:/where:)") { + let a = [1, 2, 3, 4, 3, 3, 4, 5, 3, 4, 3, 3, 3] + let indices = a.indices(of: 3) + expectEqual(indices, [2..<3, 4..<6, 8..<9, 10..<13]) + + let allTheThrees = a[indices] + expectEqual(allTheThrees.count, 7) + expectTrue(allTheThrees.allSatisfy { $0 == 3 }) + expectEqual(Array(allTheThrees), Array(repeating: 3, count: 7)) + + let lowerIndices = letterString.indices(where: { $0.isLowercase }) + let lowerOnly = letterString[lowerIndices] + expectEqualSequence(lowerOnly, lowercaseLetters) + expectEqualSequence(lowerOnly.reversed(), lowercaseLetters.reversed()) + + let upperOnly = letterString.removingSubranges(lowerIndices) + expectEqualSequence(upperOnly, uppercaseLetters) + expectEqualSequence(upperOnly.reversed(), uppercaseLetters.reversed()) + } + + RangeSetTests.test("removeSubranges") { + var a = [1, 2, 3, 4, 3, 3, 4, 5, 3, 4, 3, 3, 3] + let indices = a.indices(of: 3) + a.removeSubranges(indices) + expectEqual(a, [1, 2, 4, 4, 5, 4]) + + var numbers = Array(1...20) + numbers.removeSubranges(RangeSet([2..<5, 10..<15, 18..<20])) + expectEqual(numbers, [1, 2, 6, 7, 8, 9, 10, 16, 17, 18]) + + numbers = Array(1...20) + numbers.removeSubranges([]) + expectEqual(numbers, Array(1...20)) + + let sameNumbers = numbers.removingSubranges([]) + expectEqualSequence(numbers, sameNumbers) + + let noNumbers = numbers.removingSubranges(RangeSet(numbers.indices)) + expectEqualSequence(EmptyCollection(), noNumbers) + + var str = letterString + let lowerIndices = str.indices(where: { $0.isLowercase }) + + let upperOnly = str.removingSubranges(lowerIndices) + expectEqualSequence(upperOnly, uppercaseLetters) + + str.removeSubranges(lowerIndices) + expectEqualSequence(str, uppercaseLetters) + } + + RangeSetTests.test("moveSubranges/rangeset") { + // Move before + var numbers = Array(1...20) + let range1 = numbers.moveSubranges(RangeSet([10..<15, 18..<20]), to: 4) + expectEqual(range1, 4..<11) + expectEqual(numbers, [ + 1, 2, 3, 4, + 11, 12, 13, 14, 15, + 19, 20, + 5, 6, 7, 8, 9, 10, 16, 17, 18]) + + // Move to start + numbers = Array(1...20) + let range2 = numbers.moveSubranges(RangeSet([10..<15, 18..<20]), to: 0) + expectEqual(range2, 0..<7) + expectEqual(numbers, [ + 11, 12, 13, 14, 15, + 19, 20, + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 16, 17, 18]) + + // Move to end + numbers = Array(1...20) + let range3 = numbers.moveSubranges(RangeSet([10..<15, 18..<20]), to: 20) + expectEqual(range3, 13..<20) + expectEqual(numbers, [ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 16, 17, 18, + 11, 12, 13, 14, 15, + 19, 20, + ]) + + // Move to middle of selected elements + numbers = Array(1...20) + let range4 = numbers.moveSubranges(RangeSet([10..<15, 18..<20]), to: 14) + expectEqual(range4, 10..<17) + expectEqual(numbers, [ + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, + 11, 12, 13, 14, 15, + 19, 20, + 16, 17, 18]) + + // Move none + numbers = Array(1...20) + let range5 = numbers.moveSubranges(RangeSet(), to: 10) + expectEqual(range5, 10..<10) + expectEqual(numbers, Array(1...20)) + } + + RangeSetTests.test("moveSubranges/noCOW") { + let numbers = Array(1...20) + expectNoCopyOnWrite(numbers) { numbers in + numbers.moveSubranges(RangeSet([10..<15, 18..<20]), to: 4) + } + expectNoCopyOnWrite(numbers) { numbers in + numbers.removeSubranges(RangeSet([2..<5, 10..<15, 18..<20])) + } + } + + RangeSetTests.test("DiscontiguousSliceSlicing") { + let initial = 1...100 + + // Build an array of ranges that include alternating groups of 5 elements + // e.g. 1...5, 11...15, etc + let rangeStarts = initial.indices.every(10) + let rangeEnds = rangeStarts.compactMap { + initial.index($0, offsetBy: 5, limitedBy: initial.endIndex) + } + let ranges = zip(rangeStarts, rangeEnds).map(Range.init) + + // Create a collection of the elements represented by `ranges` without + // using `RangeSet` + let chosenElements = ranges.map { initial[$0] }.joined() + + let set = RangeSet(ranges) + let discontiguousSlice = initial[set] + expectEqualSequence(discontiguousSlice, chosenElements) + + for (chosenIdx, disIdx) in + zip(chosenElements.indices, discontiguousSlice.indices) + { + expectEqualSequence( + chosenElements[chosenIdx...], + discontiguousSlice[disIdx...] + ) + expectEqualSequence( + chosenElements[..() + set.insert(indexOfAccent, within: string) + expectEqualSequence(string[set], ["\u{301}"]) + expectEqualSequence(string[set].reversed(), ["\u{301}"]) + + set.insert(string.startIndex, within: string) + expectEqualSequence(string[set], ["C", "\u{301}"]) + expectEqualSequence(string[set].reversed(), ["\u{301}", "C"]) + + set.insert(string.index(before: string.endIndex), within: string) + expectEqualSequence(string[set], ["C", "\u{301}", "A"]) + expectEqualSequence(string[set].reversed(), ["A", "\u{301}", "C"]) + + let indexOfE = string.index(string.startIndex, offsetBy: 3) + let rangeOfE = indexOfE ..< indexOfAccent + set.insert(contentsOf: rangeOfE) + expectEqualSequence(string[set], ["C", "e\u{301}", "A"]) + expectEqualSequence(string[set].reversed(), ["A", "e\u{301}", "C"]) + } + + do { + let string = Array( + repeating: "\u{1F1E8}\u{1F1ED}\u{1F1FA}\u{1F1E6}", + count: 4 + ).joined() + + let scalars = Array(string.unicodeScalars.indices) + print(scalars.count) + let r1 = string.startIndex ..< scalars[4] + let r2 = scalars[5] ..< scalars[9] + let r3 = scalars[10] ..< string.endIndex + let set = RangeSet([r1, r2, r3]) + + let expected: [Character] = [ + "\u{1F1E8}\u{1F1ED}", "\u{1F1FA}\u{1F1E6}", + "\u{1F1ED}\u{1F1FA}", "\u{1F1E6}\u{1F1E8}", + "\u{1F1FA}\u{1F1E6}", "\u{1F1E8}\u{1F1ED}", "\u{1F1FA}\u{1F1E6}" + ] + expectEqualSequence(string[set], expected) + expectEqualSequence(string[set].reversed(), expected.reversed()) + } + } + + RangeSetTests.test("DiscontiguousSliceMutating/TooLarge") { + var initial = Array(1...21) + let evens = initial.indices(where: { $0.isMultiple(of: 2) }) + let odds = initial.indices(where: { !$0.isMultiple(of: 2) }) + + expectCrashLater() + initial[evens] = initial[odds] + } + + RangeSetTests.test("DiscontiguousSliceMutating/TooSmall") { + var initial = Array(1...21) + let evens = initial.indices(where: { $0.isMultiple(of: 2) }) + let odds = initial.indices(where: { !$0.isMultiple(of: 2) }) + + expectCrashLater() + initial[odds] = initial[evens] + } +} + +runAllTests() From 8c49a3116d1ba0f4a036d5f14e1d990adad7c88b Mon Sep 17 00:00:00 2001 From: Jeremy Schonfeld Date: Mon, 13 Nov 2023 12:10:03 -0500 Subject: [PATCH 02/17] Remove redundant DiscontiguousSlice.Index: Comparable conformance --- stdlib/public/core/DiscontiguousSlice.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/public/core/DiscontiguousSlice.swift b/stdlib/public/core/DiscontiguousSlice.swift index 0c089aad0037e..e826045348b4a 100644 --- a/stdlib/public/core/DiscontiguousSlice.swift +++ b/stdlib/public/core/DiscontiguousSlice.swift @@ -70,7 +70,7 @@ extension DiscontiguousSlice: CustomStringConvertible { extension DiscontiguousSlice { /// A position in a `DiscontiguousSlice`. @frozen - public struct Index: Comparable { + public struct Index { /// The index of the range that contains `base`. @usableFromInline internal let _rangeOffset: Int From ace5bef220077224e61f7e79abdd9c2d8eda28b1 Mon Sep 17 00:00:00 2001 From: Jeremy Schonfeld Date: Mon, 13 Nov 2023 15:05:11 -0500 Subject: [PATCH 03/17] Attempt to fix embedded build --- stdlib/public/core/CollectionAlgorithms.swift | 2 ++ stdlib/public/core/MutableCollection.swift | 2 ++ stdlib/public/core/RangeReplaceableCollection.swift | 2 ++ 3 files changed, 6 insertions(+) diff --git a/stdlib/public/core/CollectionAlgorithms.swift b/stdlib/public/core/CollectionAlgorithms.swift index b70404f9c5e3a..53a79634dbd94 100644 --- a/stdlib/public/core/CollectionAlgorithms.swift +++ b/stdlib/public/core/CollectionAlgorithms.swift @@ -213,6 +213,7 @@ extension BidirectionalCollection where Element: Equatable { // indices(where:) / indices(of:) //===----------------------------------------------------------------------===// +#if !$Embedded extension Collection { /// Returns the indices of all the elements that match the given predicate. /// @@ -284,6 +285,7 @@ extension Collection where Element: Equatable { indices(where: { $0 == element }) } } +#endif //===----------------------------------------------------------------------===// // partition(by:) diff --git a/stdlib/public/core/MutableCollection.swift b/stdlib/public/core/MutableCollection.swift index de28d06dd8349..6f21400c30930 100644 --- a/stdlib/public/core/MutableCollection.swift +++ b/stdlib/public/core/MutableCollection.swift @@ -368,6 +368,7 @@ extension MutableCollection where SubSequence == Slice { // moveSubranges(_:to:) //===----------------------------------------------------------------------===// +#if !$Embedded extension MutableCollection { /// Moves the elements in the given subranges to just before the element at /// the specified index. @@ -405,6 +406,7 @@ extension MutableCollection { return start.. Date: Tue, 14 Nov 2023 12:47:31 -0500 Subject: [PATCH 04/17] Attempt to fix macOS test failures --- test/Constraints/members.swift | 1 - .../stability-stdlib-abi-without-asserts.test | 10 - .../FrameworkABIBaseline/Swift/ABI/macos.json | 5960 ++++------------- 3 files changed, 1177 insertions(+), 4794 deletions(-) diff --git a/test/Constraints/members.swift b/test/Constraints/members.swift index e1ee63ffce684..b3f2be5086455 100644 --- a/test/Constraints/members.swift +++ b/test/Constraints/members.swift @@ -634,7 +634,6 @@ func rdar_50467583_and_50909555() { // expected-note@-2 {{found candidate with type '(Int) -> Int'}} // expected-note@-3 {{found candidate with type '(Range) -> ArraySlice'}} // expected-note@-4 {{found candidate with type '((UnboundedRange_) -> ()) -> ArraySlice'}} - // expected-note@-5 {{found candidate with type '(RangeSet.Index>) -> DiscontiguousSlice<[Int]>' (aka '(RangeSet) -> DiscontiguousSlice>')}} } // rdar://problem/50909555 diff --git a/test/api-digester/stability-stdlib-abi-without-asserts.test b/test/api-digester/stability-stdlib-abi-without-asserts.test index f487f9ce222f9..342e3e78f2a9b 100644 --- a/test/api-digester/stability-stdlib-abi-without-asserts.test +++ b/test/api-digester/stability-stdlib-abi-without-asserts.test @@ -60,22 +60,12 @@ Func _swift_retainCount(_:) is a new API without @available attribute Func _swift_unownedRetainCount(_:) is a new API without @available attribute Func _swift_weakRetainCount(_:) is a new API without @available attribute -Func Collection.removingSubranges(_:) has been removed -Func Collection.subranges(of:) has been removed -Func Collection.subranges(where:) has been removed -Func MutableCollection.moveSubranges(_:to:) has been removed -Func MutableCollection.removeSubranges(_:) has been removed -Func RangeReplaceableCollection.removeSubranges(_:) has been removed Struct AnyHashable has added a conformance to an existing protocol _HasCustomAnyHashableRepresentation Class AnyKeyPath has added a conformance to an existing protocol CustomDebugStringConvertible Class KeyPath has added a conformance to an existing protocol CustomDebugStringConvertible Class PartialKeyPath has added a conformance to an existing protocol CustomDebugStringConvertible Class ReferenceWritableKeyPath has added a conformance to an existing protocol CustomDebugStringConvertible Class WritableKeyPath has added a conformance to an existing protocol CustomDebugStringConvertible -Struct DiscontiguousSlice has been removed -Struct RangeSet has been removed -Subscript Collection.subscript(_:) has been removed -Subscript MutableCollection.subscript(_:) has been removed Protocol CodingKey has added inherited protocol Sendable Protocol CodingKey has generic signature change from to Protocol Error has added inherited protocol Sendable diff --git a/utils/api_checker/FrameworkABIBaseline/Swift/ABI/macos.json b/utils/api_checker/FrameworkABIBaseline/Swift/ABI/macos.json index 9c0e5b563fd2a..46eb8702520f2 100644 --- a/utils/api_checker/FrameworkABIBaseline/Swift/ABI/macos.json +++ b/utils/api_checker/FrameworkABIBaseline/Swift/ABI/macos.json @@ -41859,108 +41859,6 @@ "throwing": true, "funcSelfKind": "NonMutating" }, - { - "kind": "Function", - "name": "subranges", - "printedName": "subranges(where:)", - "children": [ - { - "kind": "TypeNominal", - "name": "RangeSet", - "printedName": "Swift.RangeSet<τ_0_0.Index>", - "children": [ - { - "kind": "TypeNominal", - "name": "DependentMember", - "printedName": "τ_0_0.Index" - } - ], - "usr": "s:s8RangeSetV" - }, - { - "kind": "TypeFunc", - "name": "Function", - "printedName": "(τ_0_0.Element) throws -> Swift.Bool", - "children": [ - { - "kind": "TypeNominal", - "name": "Bool", - "printedName": "Swift.Bool", - "usr": "s:Sb" - }, - { - "kind": "TypeNominal", - "name": "DependentMember", - "printedName": "τ_0_0.Element" - } - ], - "typeAttributes": [ - "noescape" - ] - } - ], - "declKind": "Func", - "usr": "s:SlsE9subranges5wheres8RangeSetVy5IndexQzGSb7ElementQzKXE_tKF", - "moduleName": "Swift", - "genericSig": "<τ_0_0 where τ_0_0 : Swift.Collection>", - "sugared_genericSig": "", - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", - "declAttributes": [ - "Rethrows", - "Available", - "Available", - "Available", - "Available" - ], - "throwing": true, - "funcSelfKind": "NonMutating" - }, - { - "kind": "Function", - "name": "subranges", - "printedName": "subranges(of:)", - "children": [ - { - "kind": "TypeNominal", - "name": "RangeSet", - "printedName": "Swift.RangeSet<τ_0_0.Index>", - "children": [ - { - "kind": "TypeNominal", - "name": "DependentMember", - "printedName": "τ_0_0.Index" - } - ], - "usr": "s:s8RangeSetV" - }, - { - "kind": "TypeNominal", - "name": "DependentMember", - "printedName": "τ_0_0.Element" - } - ], - "declKind": "Func", - "usr": "s:SlsSQ7ElementRpzrlE9subranges2ofs8RangeSetVy5IndexQzGAB_tF", - "moduleName": "Swift", - "genericSig": "<τ_0_0 where τ_0_0 : Swift.Collection, τ_0_0.Element : Swift.Equatable>", - "sugared_genericSig": "", - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", - "declAttributes": [ - "Available", - "Available", - "Available", - "Available" - ], - "funcSelfKind": "NonMutating" - }, { "kind": "Function", "name": "_copyToContiguousArray", @@ -42265,146 +42163,6 @@ "Available" ], "funcSelfKind": "NonMutating" - }, - { - "kind": "Subscript", - "name": "subscript", - "printedName": "subscript(_:)", - "children": [ - { - "kind": "TypeNominal", - "name": "DiscontiguousSlice", - "printedName": "Swift.DiscontiguousSlice<τ_0_0>", - "children": [ - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "τ_0_0" - } - ], - "usr": "s:s18DiscontiguousSliceV" - }, - { - "kind": "TypeNominal", - "name": "RangeSet", - "printedName": "Swift.RangeSet<τ_0_0.Index>", - "children": [ - { - "kind": "TypeNominal", - "name": "DependentMember", - "printedName": "τ_0_0.Index" - } - ], - "usr": "s:s8RangeSetV" - } - ], - "declKind": "Subscript", - "usr": "s:SlsEys18DiscontiguousSliceVyxGs8RangeSetVy5IndexQzGcip", - "moduleName": "Swift", - "genericSig": "<τ_0_0 where τ_0_0 : Swift.Collection>", - "sugared_genericSig": "", - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", - "declAttributes": [ - "Available", - "Available", - "Available", - "Available" - ], - "accessors": [ - { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", - "children": [ - { - "kind": "TypeNominal", - "name": "DiscontiguousSlice", - "printedName": "Swift.DiscontiguousSlice<τ_0_0>", - "children": [ - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "τ_0_0" - } - ], - "usr": "s:s18DiscontiguousSliceV" - }, - { - "kind": "TypeNominal", - "name": "RangeSet", - "printedName": "Swift.RangeSet<τ_0_0.Index>", - "children": [ - { - "kind": "TypeNominal", - "name": "DependentMember", - "printedName": "τ_0_0.Index" - } - ], - "usr": "s:s8RangeSetV" - } - ], - "declKind": "Accessor", - "usr": "s:SlsEys18DiscontiguousSliceVyxGs8RangeSetVy5IndexQzGcig", - "moduleName": "Swift", - "genericSig": "<τ_0_0 where τ_0_0 : Swift.Collection>", - "sugared_genericSig": "", - "accessorKind": "get" - } - ] - }, - { - "kind": "Function", - "name": "removingSubranges", - "printedName": "removingSubranges(_:)", - "children": [ - { - "kind": "TypeNominal", - "name": "DiscontiguousSlice", - "printedName": "Swift.DiscontiguousSlice<τ_0_0>", - "children": [ - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "τ_0_0" - } - ], - "usr": "s:s18DiscontiguousSliceV" - }, - { - "kind": "TypeNominal", - "name": "RangeSet", - "printedName": "Swift.RangeSet<τ_0_0.Index>", - "children": [ - { - "kind": "TypeNominal", - "name": "DependentMember", - "printedName": "τ_0_0.Index" - } - ], - "usr": "s:s8RangeSetV" - } - ], - "declKind": "Func", - "usr": "s:SlsE17removingSubrangesys18DiscontiguousSliceVyxGs8RangeSetVy5IndexQzGF", - "moduleName": "Swift", - "genericSig": "<τ_0_0 where τ_0_0 : Swift.Collection>", - "sugared_genericSig": "", - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", - "declAttributes": [ - "Available", - "Available", - "Available", - "Available" - ], - "funcSelfKind": "NonMutating" } ], "declKind": "Protocol", @@ -114117,62 +113875,6 @@ ], "funcSelfKind": "Mutating" }, - { - "kind": "Function", - "name": "moveSubranges", - "printedName": "moveSubranges(_:to:)", - "children": [ - { - "kind": "TypeNominal", - "name": "Range", - "printedName": "Swift.Range<τ_0_0.Index>", - "children": [ - { - "kind": "TypeNominal", - "name": "DependentMember", - "printedName": "τ_0_0.Index" - } - ], - "usr": "s:Sn" - }, - { - "kind": "TypeNominal", - "name": "RangeSet", - "printedName": "Swift.RangeSet<τ_0_0.Index>", - "children": [ - { - "kind": "TypeNominal", - "name": "DependentMember", - "printedName": "τ_0_0.Index" - } - ], - "usr": "s:s8RangeSetV" - }, - { - "kind": "TypeNominal", - "name": "DependentMember", - "printedName": "τ_0_0.Index" - } - ], - "declKind": "Func", - "usr": "s:SMsE13moveSubranges_2toSny5IndexQzGs8RangeSetVyADG_ADtF", - "moduleName": "Swift", - "genericSig": "<τ_0_0 where τ_0_0 : Swift.MutableCollection>", - "sugared_genericSig": "", - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", - "declAttributes": [ - "DiscardableResult", - "Available", - "Available", - "Available", - "Available" - ], - "funcSelfKind": "Mutating" - }, { "kind": "Subscript", "name": "subscript", @@ -114441,48 +114143,6 @@ } ] }, - { - "kind": "Function", - "name": "removeSubranges", - "printedName": "removeSubranges(_:)", - "children": [ - { - "kind": "TypeNominal", - "name": "Void", - "printedName": "()" - }, - { - "kind": "TypeNominal", - "name": "RangeSet", - "printedName": "Swift.RangeSet<τ_0_0.Index>", - "children": [ - { - "kind": "TypeNominal", - "name": "DependentMember", - "printedName": "τ_0_0.Index" - } - ], - "usr": "s:s8RangeSetV" - } - ], - "declKind": "Func", - "usr": "s:SMsSmRzrlE15removeSubrangesyys8RangeSetVy5IndexSlQzGF", - "moduleName": "Swift", - "genericSig": "<τ_0_0 where τ_0_0 : Swift.MutableCollection, τ_0_0 : Swift.RangeReplaceableCollection>", - "sugared_genericSig": "", - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", - "declAttributes": [ - "Available", - "Available", - "Available", - "Available" - ], - "funcSelfKind": "Mutating" - }, { "kind": "Function", "name": "reverse", @@ -114757,183 +114417,6 @@ "Inlinable" ], "funcSelfKind": "Mutating" - }, - { - "kind": "Subscript", - "name": "subscript", - "printedName": "subscript(_:)", - "children": [ - { - "kind": "TypeNominal", - "name": "DiscontiguousSlice", - "printedName": "Swift.DiscontiguousSlice<τ_0_0>", - "children": [ - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "τ_0_0" - } - ], - "usr": "s:s18DiscontiguousSliceV" - }, - { - "kind": "TypeNominal", - "name": "RangeSet", - "printedName": "Swift.RangeSet<τ_0_0.Index>", - "children": [ - { - "kind": "TypeNominal", - "name": "DependentMember", - "printedName": "τ_0_0.Index" - } - ], - "usr": "s:s8RangeSetV" - } - ], - "declKind": "Subscript", - "usr": "s:SMsEys18DiscontiguousSliceVyxGs8RangeSetVy5IndexQzGcip", - "moduleName": "Swift", - "genericSig": "<τ_0_0 where τ_0_0 : Swift.MutableCollection>", - "sugared_genericSig": "", - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", - "declAttributes": [ - "Available", - "Available", - "Available", - "Available" - ], - "accessors": [ - { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", - "children": [ - { - "kind": "TypeNominal", - "name": "DiscontiguousSlice", - "printedName": "Swift.DiscontiguousSlice<τ_0_0>", - "children": [ - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "τ_0_0" - } - ], - "usr": "s:s18DiscontiguousSliceV" - }, - { - "kind": "TypeNominal", - "name": "RangeSet", - "printedName": "Swift.RangeSet<τ_0_0.Index>", - "children": [ - { - "kind": "TypeNominal", - "name": "DependentMember", - "printedName": "τ_0_0.Index" - } - ], - "usr": "s:s8RangeSetV" - } - ], - "declKind": "Accessor", - "usr": "s:SMsEys18DiscontiguousSliceVyxGs8RangeSetVy5IndexQzGcig", - "moduleName": "Swift", - "genericSig": "<τ_0_0 where τ_0_0 : Swift.MutableCollection>", - "sugared_genericSig": "", - "accessorKind": "get" - }, - { - "kind": "Accessor", - "name": "Set", - "printedName": "Set()", - "children": [ - { - "kind": "TypeNominal", - "name": "Void", - "printedName": "()" - }, - { - "kind": "TypeNominal", - "name": "DiscontiguousSlice", - "printedName": "Swift.DiscontiguousSlice<τ_0_0>", - "children": [ - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "τ_0_0" - } - ], - "usr": "s:s18DiscontiguousSliceV" - }, - { - "kind": "TypeNominal", - "name": "RangeSet", - "printedName": "Swift.RangeSet<τ_0_0.Index>", - "children": [ - { - "kind": "TypeNominal", - "name": "DependentMember", - "printedName": "τ_0_0.Index" - } - ], - "usr": "s:s8RangeSetV" - } - ], - "declKind": "Accessor", - "usr": "s:SMsEys18DiscontiguousSliceVyxGs8RangeSetVy5IndexQzGcis", - "moduleName": "Swift", - "genericSig": "<τ_0_0 where τ_0_0 : Swift.MutableCollection>", - "sugared_genericSig": "", - "accessorKind": "set" - }, - { - "kind": "Accessor", - "name": "Modify", - "printedName": "Modify()", - "children": [ - { - "kind": "TypeNominal", - "name": "Void", - "printedName": "()" - }, - { - "kind": "TypeNominal", - "name": "RangeSet", - "printedName": "Swift.RangeSet<τ_0_0.Index>", - "children": [ - { - "kind": "TypeNominal", - "name": "DependentMember", - "printedName": "τ_0_0.Index" - } - ], - "usr": "s:s8RangeSetV" - } - ], - "declKind": "Accessor", - "usr": "s:SMsEys18DiscontiguousSliceVyxGs8RangeSetVy5IndexQzGciM", - "moduleName": "Swift", - "genericSig": "<τ_0_0 where τ_0_0 : Swift.MutableCollection>", - "sugared_genericSig": "", - "implicit": true, - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", - "declAttributes": [ - "Available", - "Available", - "Available", - "Available" - ], - "accessorKind": "_modify" - } - ] } ], "declKind": "Protocol", @@ -131294,48 +130777,6 @@ "throwing": true, "funcSelfKind": "Mutating" }, - { - "kind": "Function", - "name": "removeSubranges", - "printedName": "removeSubranges(_:)", - "children": [ - { - "kind": "TypeNominal", - "name": "Void", - "printedName": "()" - }, - { - "kind": "TypeNominal", - "name": "RangeSet", - "printedName": "Swift.RangeSet<τ_0_0.Index>", - "children": [ - { - "kind": "TypeNominal", - "name": "DependentMember", - "printedName": "τ_0_0.Index" - } - ], - "usr": "s:s8RangeSetV" - } - ], - "declKind": "Func", - "usr": "s:SmsE15removeSubrangesyys8RangeSetVy5IndexQzGF", - "moduleName": "Swift", - "genericSig": "<τ_0_0 where τ_0_0 : Swift.RangeReplaceableCollection>", - "sugared_genericSig": "", - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", - "declAttributes": [ - "Available", - "Available", - "Available", - "Available" - ], - "funcSelfKind": "Mutating" - }, { "kind": "Function", "name": "applying", @@ -203074,440 +202515,466 @@ }, { "kind": "TypeDecl", - "name": "DiscontiguousSlice", - "printedName": "DiscontiguousSlice", + "name": "Mirror", + "printedName": "Mirror", "children": [ { - "kind": "Var", - "name": "base", - "printedName": "base", + "kind": "TypeDecl", + "name": "AncestorRepresentation", + "printedName": "AncestorRepresentation", "children": [ { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "τ_0_0" - } - ], - "declKind": "Var", - "usr": "s:s18DiscontiguousSliceV4basexvp", - "moduleName": "Swift", - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", - "declAttributes": [ - "HasStorage" - ], - "fixedbinaryorder": 0, - "hasStorage": true, - "accessors": [ - { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", + "kind": "Var", + "name": "generated", + "printedName": "generated", "children": [ { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "τ_0_0" + "kind": "TypeFunc", + "name": "Function", + "printedName": "(Swift.Mirror.AncestorRepresentation.Type) -> Swift.Mirror.AncestorRepresentation", + "children": [ + { + "kind": "TypeNominal", + "name": "AncestorRepresentation", + "printedName": "Swift.Mirror.AncestorRepresentation", + "usr": "s:s6MirrorV22AncestorRepresentationO" + }, + { + "kind": "TypeNominal", + "name": "Metatype", + "printedName": "Swift.Mirror.AncestorRepresentation.Type", + "children": [ + { + "kind": "TypeNominal", + "name": "AncestorRepresentation", + "printedName": "Swift.Mirror.AncestorRepresentation", + "usr": "s:s6MirrorV22AncestorRepresentationO" + } + ] + } + ] } ], - "declKind": "Accessor", - "usr": "s:s18DiscontiguousSliceV4basexvg", - "moduleName": "Swift", - "genericSig": "<τ_0_0 where τ_0_0 : Swift.Collection>", - "sugared_genericSig": "", - "implicit": true, - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", - "declAttributes": [ - "Transparent" - ], - "accessorKind": "get" + "declKind": "EnumElement", + "usr": "s:s6MirrorV22AncestorRepresentationO9generatedyA2DmF", + "moduleName": "Swift" }, { - "kind": "Accessor", - "name": "Set", - "printedName": "Set()", + "kind": "Var", + "name": "customized", + "printedName": "customized", "children": [ { - "kind": "TypeNominal", - "name": "Void", - "printedName": "()" - }, - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "τ_0_0" + "kind": "TypeFunc", + "name": "Function", + "printedName": "(Swift.Mirror.AncestorRepresentation.Type) -> (@escaping () -> Swift.Mirror) -> Swift.Mirror.AncestorRepresentation", + "children": [ + { + "kind": "TypeFunc", + "name": "Function", + "printedName": "(@escaping () -> Swift.Mirror) -> Swift.Mirror.AncestorRepresentation", + "children": [ + { + "kind": "TypeNominal", + "name": "AncestorRepresentation", + "printedName": "Swift.Mirror.AncestorRepresentation", + "usr": "s:s6MirrorV22AncestorRepresentationO" + }, + { + "kind": "TypeFunc", + "name": "Function", + "printedName": "() -> Swift.Mirror", + "children": [ + { + "kind": "TypeNominal", + "name": "Mirror", + "printedName": "Swift.Mirror", + "usr": "s:s6MirrorV" + }, + { + "kind": "TypeNominal", + "name": "Void", + "printedName": "()" + } + ] + } + ] + }, + { + "kind": "TypeNominal", + "name": "Metatype", + "printedName": "Swift.Mirror.AncestorRepresentation.Type", + "children": [ + { + "kind": "TypeNominal", + "name": "AncestorRepresentation", + "printedName": "Swift.Mirror.AncestorRepresentation", + "usr": "s:s6MirrorV22AncestorRepresentationO" + } + ] + } + ] } ], - "declKind": "Accessor", - "usr": "s:s18DiscontiguousSliceV4basexvs", - "moduleName": "Swift", - "genericSig": "<τ_0_0 where τ_0_0 : Swift.Collection>", - "sugared_genericSig": "", - "implicit": true, - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", - "declAttributes": [ - "Transparent" - ], - "accessorKind": "set" + "declKind": "EnumElement", + "usr": "s:s6MirrorV22AncestorRepresentationO10customizedyAdByccADmF", + "moduleName": "Swift" }, { - "kind": "Accessor", - "name": "Modify", - "printedName": "Modify()", + "kind": "Var", + "name": "suppressed", + "printedName": "suppressed", "children": [ { - "kind": "TypeNominal", - "name": "Void", - "printedName": "()" + "kind": "TypeFunc", + "name": "Function", + "printedName": "(Swift.Mirror.AncestorRepresentation.Type) -> Swift.Mirror.AncestorRepresentation", + "children": [ + { + "kind": "TypeNominal", + "name": "AncestorRepresentation", + "printedName": "Swift.Mirror.AncestorRepresentation", + "usr": "s:s6MirrorV22AncestorRepresentationO" + }, + { + "kind": "TypeNominal", + "name": "Metatype", + "printedName": "Swift.Mirror.AncestorRepresentation.Type", + "children": [ + { + "kind": "TypeNominal", + "name": "AncestorRepresentation", + "printedName": "Swift.Mirror.AncestorRepresentation", + "usr": "s:s6MirrorV22AncestorRepresentationO" + } + ] + } + ] } ], - "declKind": "Accessor", - "usr": "s:s18DiscontiguousSliceV4basexvM", - "moduleName": "Swift", - "genericSig": "<τ_0_0 where τ_0_0 : Swift.Collection>", - "sugared_genericSig": "", - "implicit": true, - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", - "declAttributes": [ - "Transparent" - ], - "accessorKind": "_modify" + "declKind": "EnumElement", + "usr": "s:s6MirrorV22AncestorRepresentationO10suppressedyA2DmF", + "moduleName": "Swift" } - ] + ], + "declKind": "Enum", + "usr": "s:s6MirrorV22AncestorRepresentationO", + "moduleName": "Swift" }, { - "kind": "Var", - "name": "subranges", - "printedName": "subranges", + "kind": "Constructor", + "name": "init", + "printedName": "init(reflecting:)", "children": [ { "kind": "TypeNominal", - "name": "RangeSet", - "printedName": "Swift.RangeSet<τ_0_0.Index>", - "children": [ - { - "kind": "TypeNominal", - "name": "DependentMember", - "printedName": "τ_0_0.Index" - } - ], - "usr": "s:s8RangeSetV" + "name": "Mirror", + "printedName": "Swift.Mirror", + "usr": "s:s6MirrorV" + }, + { + "kind": "TypeNominal", + "name": "ProtocolComposition", + "printedName": "Any" } ], - "declKind": "Var", - "usr": "s:s18DiscontiguousSliceV9subrangess8RangeSetVy5IndexQzGvp", + "declKind": "Constructor", + "usr": "s:s6MirrorV10reflectingAByp_tcfc", "moduleName": "Swift", - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", - "declAttributes": [ - "HasStorage" - ], - "fixedbinaryorder": 1, - "hasStorage": true, - "accessors": [ + "init_kind": "Designated" + }, + { + "kind": "TypeDecl", + "name": "DisplayStyle", + "printedName": "DisplayStyle", + "children": [ { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", + "kind": "Var", + "name": "struct", + "printedName": "struct", "children": [ { - "kind": "TypeNominal", - "name": "RangeSet", - "printedName": "Swift.RangeSet<τ_0_0.Index>", + "kind": "TypeFunc", + "name": "Function", + "printedName": "(Swift.Mirror.DisplayStyle.Type) -> Swift.Mirror.DisplayStyle", "children": [ { "kind": "TypeNominal", - "name": "DependentMember", - "printedName": "τ_0_0.Index" + "name": "DisplayStyle", + "printedName": "Swift.Mirror.DisplayStyle", + "usr": "s:s6MirrorV12DisplayStyleO" + }, + { + "kind": "TypeNominal", + "name": "Metatype", + "printedName": "Swift.Mirror.DisplayStyle.Type", + "children": [ + { + "kind": "TypeNominal", + "name": "DisplayStyle", + "printedName": "Swift.Mirror.DisplayStyle", + "usr": "s:s6MirrorV12DisplayStyleO" + } + ] } - ], - "usr": "s:s8RangeSetV" + ] } ], - "declKind": "Accessor", - "usr": "s:s18DiscontiguousSliceV9subrangess8RangeSetVy5IndexQzGvg", - "moduleName": "Swift", - "genericSig": "<τ_0_0 where τ_0_0 : Swift.Collection>", - "sugared_genericSig": "", - "implicit": true, - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", - "declAttributes": [ - "Transparent" - ], - "accessorKind": "get" + "declKind": "EnumElement", + "usr": "s:s6MirrorV12DisplayStyleO6structyA2DmF", + "moduleName": "Swift" }, { - "kind": "Accessor", - "name": "Set", - "printedName": "Set()", + "kind": "Var", + "name": "class", + "printedName": "class", "children": [ { - "kind": "TypeNominal", - "name": "Void", - "printedName": "()" - }, - { - "kind": "TypeNominal", - "name": "RangeSet", - "printedName": "Swift.RangeSet<τ_0_0.Index>", + "kind": "TypeFunc", + "name": "Function", + "printedName": "(Swift.Mirror.DisplayStyle.Type) -> Swift.Mirror.DisplayStyle", "children": [ { "kind": "TypeNominal", - "name": "DependentMember", - "printedName": "τ_0_0.Index" + "name": "DisplayStyle", + "printedName": "Swift.Mirror.DisplayStyle", + "usr": "s:s6MirrorV12DisplayStyleO" + }, + { + "kind": "TypeNominal", + "name": "Metatype", + "printedName": "Swift.Mirror.DisplayStyle.Type", + "children": [ + { + "kind": "TypeNominal", + "name": "DisplayStyle", + "printedName": "Swift.Mirror.DisplayStyle", + "usr": "s:s6MirrorV12DisplayStyleO" + } + ] } - ], - "usr": "s:s8RangeSetV" + ] } ], - "declKind": "Accessor", - "usr": "s:s18DiscontiguousSliceV9subrangess8RangeSetVy5IndexQzGvs", - "moduleName": "Swift", - "genericSig": "<τ_0_0 where τ_0_0 : Swift.Collection>", - "sugared_genericSig": "", - "implicit": true, - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", - "declAttributes": [ - "Transparent" - ], - "accessorKind": "set" + "declKind": "EnumElement", + "usr": "s:s6MirrorV12DisplayStyleO5classyA2DmF", + "moduleName": "Swift" }, { - "kind": "Accessor", - "name": "Modify", - "printedName": "Modify()", + "kind": "Var", + "name": "enum", + "printedName": "enum", "children": [ { - "kind": "TypeNominal", - "name": "Void", - "printedName": "()" + "kind": "TypeFunc", + "name": "Function", + "printedName": "(Swift.Mirror.DisplayStyle.Type) -> Swift.Mirror.DisplayStyle", + "children": [ + { + "kind": "TypeNominal", + "name": "DisplayStyle", + "printedName": "Swift.Mirror.DisplayStyle", + "usr": "s:s6MirrorV12DisplayStyleO" + }, + { + "kind": "TypeNominal", + "name": "Metatype", + "printedName": "Swift.Mirror.DisplayStyle.Type", + "children": [ + { + "kind": "TypeNominal", + "name": "DisplayStyle", + "printedName": "Swift.Mirror.DisplayStyle", + "usr": "s:s6MirrorV12DisplayStyleO" + } + ] + } + ] } ], - "declKind": "Accessor", - "usr": "s:s18DiscontiguousSliceV9subrangess8RangeSetVy5IndexQzGvM", - "moduleName": "Swift", - "genericSig": "<τ_0_0 where τ_0_0 : Swift.Collection>", - "sugared_genericSig": "", - "implicit": true, - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", - "declAttributes": [ - "Transparent" - ], - "accessorKind": "_modify" - } - ] - }, - { - "kind": "TypeDecl", - "name": "Index", - "printedName": "Index", - "children": [ + "declKind": "EnumElement", + "usr": "s:s6MirrorV12DisplayStyleO4enumyA2DmF", + "moduleName": "Swift" + }, { "kind": "Var", - "name": "_rangeOffset", - "printedName": "_rangeOffset", + "name": "tuple", + "printedName": "tuple", "children": [ { - "kind": "TypeNominal", - "name": "Int", - "printedName": "Swift.Int", - "usr": "s:Si" + "kind": "TypeFunc", + "name": "Function", + "printedName": "(Swift.Mirror.DisplayStyle.Type) -> Swift.Mirror.DisplayStyle", + "children": [ + { + "kind": "TypeNominal", + "name": "DisplayStyle", + "printedName": "Swift.Mirror.DisplayStyle", + "usr": "s:s6MirrorV12DisplayStyleO" + }, + { + "kind": "TypeNominal", + "name": "Metatype", + "printedName": "Swift.Mirror.DisplayStyle.Type", + "children": [ + { + "kind": "TypeNominal", + "name": "DisplayStyle", + "printedName": "Swift.Mirror.DisplayStyle", + "usr": "s:s6MirrorV12DisplayStyleO" + } + ] + } + ] } ], - "declKind": "Var", - "usr": "s:s18DiscontiguousSliceV5IndexV12_rangeOffsetSivp", - "moduleName": "Swift", - "isInternal": true, - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", - "declAttributes": [ - "HasStorage" - ], - "fixedbinaryorder": 0, - "hasStorage": true + "declKind": "EnumElement", + "usr": "s:s6MirrorV12DisplayStyleO5tupleyA2DmF", + "moduleName": "Swift" }, { "kind": "Var", - "name": "base", - "printedName": "base", + "name": "optional", + "printedName": "optional", "children": [ { - "kind": "TypeNominal", - "name": "DependentMember", - "printedName": "τ_0_0.Index" - } - ], - "declKind": "Var", - "usr": "s:s18DiscontiguousSliceV5IndexV4baseACQzvp", - "moduleName": "Swift", - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", - "declAttributes": [ - "HasStorage" - ], - "fixedbinaryorder": 1, - "hasStorage": true, - "accessors": [ - { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", + "kind": "TypeFunc", + "name": "Function", + "printedName": "(Swift.Mirror.DisplayStyle.Type) -> Swift.Mirror.DisplayStyle", "children": [ { "kind": "TypeNominal", - "name": "DependentMember", - "printedName": "τ_0_0.Index" + "name": "DisplayStyle", + "printedName": "Swift.Mirror.DisplayStyle", + "usr": "s:s6MirrorV12DisplayStyleO" + }, + { + "kind": "TypeNominal", + "name": "Metatype", + "printedName": "Swift.Mirror.DisplayStyle.Type", + "children": [ + { + "kind": "TypeNominal", + "name": "DisplayStyle", + "printedName": "Swift.Mirror.DisplayStyle", + "usr": "s:s6MirrorV12DisplayStyleO" + } + ] } - ], - "declKind": "Accessor", - "usr": "s:s18DiscontiguousSliceV5IndexV4baseACQzvg", - "moduleName": "Swift", - "genericSig": "<τ_0_0 where τ_0_0 : Swift.Collection>", - "sugared_genericSig": "", - "implicit": true, - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", - "declAttributes": [ - "Transparent" - ], - "accessorKind": "get" - }, + ] + } + ], + "declKind": "EnumElement", + "usr": "s:s6MirrorV12DisplayStyleO8optionalyA2DmF", + "moduleName": "Swift" + }, + { + "kind": "Var", + "name": "collection", + "printedName": "collection", + "children": [ { - "kind": "Accessor", - "name": "Set", - "printedName": "Set()", + "kind": "TypeFunc", + "name": "Function", + "printedName": "(Swift.Mirror.DisplayStyle.Type) -> Swift.Mirror.DisplayStyle", "children": [ { "kind": "TypeNominal", - "name": "Void", - "printedName": "()" + "name": "DisplayStyle", + "printedName": "Swift.Mirror.DisplayStyle", + "usr": "s:s6MirrorV12DisplayStyleO" }, { "kind": "TypeNominal", - "name": "DependentMember", - "printedName": "τ_0_0.Index" + "name": "Metatype", + "printedName": "Swift.Mirror.DisplayStyle.Type", + "children": [ + { + "kind": "TypeNominal", + "name": "DisplayStyle", + "printedName": "Swift.Mirror.DisplayStyle", + "usr": "s:s6MirrorV12DisplayStyleO" + } + ] } - ], - "declKind": "Accessor", - "usr": "s:s18DiscontiguousSliceV5IndexV4baseACQzvs", - "moduleName": "Swift", - "genericSig": "<τ_0_0 where τ_0_0 : Swift.Collection>", - "sugared_genericSig": "", - "implicit": true, - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", - "declAttributes": [ - "Transparent" - ], - "accessorKind": "set" - }, + ] + } + ], + "declKind": "EnumElement", + "usr": "s:s6MirrorV12DisplayStyleO10collectionyA2DmF", + "moduleName": "Swift" + }, + { + "kind": "Var", + "name": "dictionary", + "printedName": "dictionary", + "children": [ { - "kind": "Accessor", - "name": "Modify", - "printedName": "Modify()", + "kind": "TypeFunc", + "name": "Function", + "printedName": "(Swift.Mirror.DisplayStyle.Type) -> Swift.Mirror.DisplayStyle", "children": [ { "kind": "TypeNominal", - "name": "Void", - "printedName": "()" + "name": "DisplayStyle", + "printedName": "Swift.Mirror.DisplayStyle", + "usr": "s:s6MirrorV12DisplayStyleO" + }, + { + "kind": "TypeNominal", + "name": "Metatype", + "printedName": "Swift.Mirror.DisplayStyle.Type", + "children": [ + { + "kind": "TypeNominal", + "name": "DisplayStyle", + "printedName": "Swift.Mirror.DisplayStyle", + "usr": "s:s6MirrorV12DisplayStyleO" + } + ] } - ], - "declKind": "Accessor", - "usr": "s:s18DiscontiguousSliceV5IndexV4baseACQzvM", - "moduleName": "Swift", - "genericSig": "<τ_0_0 where τ_0_0 : Swift.Collection>", - "sugared_genericSig": "", - "implicit": true, - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", - "declAttributes": [ - "Transparent" - ], - "accessorKind": "_modify" + ] } - ] + ], + "declKind": "EnumElement", + "usr": "s:s6MirrorV12DisplayStyleO10dictionaryyA2DmF", + "moduleName": "Swift" }, { - "kind": "Function", - "name": "<", - "printedName": "<(_:_:)", + "kind": "Var", + "name": "set", + "printedName": "set", "children": [ { - "kind": "TypeNominal", - "name": "Bool", - "printedName": "Swift.Bool", - "usr": "s:Sb" - }, - { - "kind": "TypeNominal", - "name": "Index", - "printedName": "Swift.DiscontiguousSlice<τ_0_0>.Index", - "usr": "s:s18DiscontiguousSliceV5IndexV" - }, - { - "kind": "TypeNominal", - "name": "Index", - "printedName": "Swift.DiscontiguousSlice<τ_0_0>.Index", - "usr": "s:s18DiscontiguousSliceV5IndexV" + "kind": "TypeFunc", + "name": "Function", + "printedName": "(Swift.Mirror.DisplayStyle.Type) -> Swift.Mirror.DisplayStyle", + "children": [ + { + "kind": "TypeNominal", + "name": "DisplayStyle", + "printedName": "Swift.Mirror.DisplayStyle", + "usr": "s:s6MirrorV12DisplayStyleO" + }, + { + "kind": "TypeNominal", + "name": "Metatype", + "printedName": "Swift.Mirror.DisplayStyle.Type", + "children": [ + { + "kind": "TypeNominal", + "name": "DisplayStyle", + "printedName": "Swift.Mirror.DisplayStyle", + "usr": "s:s6MirrorV12DisplayStyleO" + } + ] + } + ] } ], - "declKind": "Func", - "usr": "s:s18DiscontiguousSliceV5IndexV1loiySbADyx_G_AFtFZ", - "moduleName": "Swift", - "genericSig": "<τ_0_0 where τ_0_0 : Swift.Collection>", - "sugared_genericSig": "", - "static": true, - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", - "funcSelfKind": "NonMutating" + "declKind": "EnumElement", + "usr": "s:s6MirrorV12DisplayStyleO3setyA2DmF", + "moduleName": "Swift" }, { "kind": "Function", @@ -203522,29 +202989,22 @@ }, { "kind": "TypeNominal", - "name": "Index", - "printedName": "Swift.DiscontiguousSlice<τ_0_0>.Index", - "usr": "s:s18DiscontiguousSliceV5IndexV" + "name": "DisplayStyle", + "printedName": "Swift.Mirror.DisplayStyle", + "usr": "s:s6MirrorV12DisplayStyleO" }, { "kind": "TypeNominal", - "name": "Index", - "printedName": "Swift.DiscontiguousSlice<τ_0_0>.Index", - "usr": "s:s18DiscontiguousSliceV5IndexV" + "name": "DisplayStyle", + "printedName": "Swift.Mirror.DisplayStyle", + "usr": "s:s6MirrorV12DisplayStyleO" } ], "declKind": "Func", - "usr": "s:s18DiscontiguousSliceV5IndexV2eeoiySbADyx_G_AFtFZ", + "usr": "s:s6MirrorV12DisplayStyleO2eeoiySbAD_ADtFZ", "moduleName": "Swift", - "genericSig": "<τ_0_0 where τ_0_0 : Swift.Collection>", - "sugared_genericSig": "", "static": true, "implicit": true, - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", "funcSelfKind": "NonMutating" }, { @@ -203560,14 +203020,9 @@ } ], "declKind": "Var", - "usr": "s:s18DiscontiguousSliceV5IndexVsSHACRpzrlE9hashValueSivp", + "usr": "s:s6MirrorV12DisplayStyleO9hashValueSivp", "moduleName": "Swift", "implicit": true, - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", "accessors": [ { "kind": "Accessor", @@ -203582,16 +203037,9 @@ } ], "declKind": "Accessor", - "usr": "s:s18DiscontiguousSliceV5IndexVsSHACRpzrlE9hashValueSivg", + "usr": "s:s6MirrorV12DisplayStyleO9hashValueSivg", "moduleName": "Swift", - "genericSig": "<τ_0_0 where τ_0_0 : Swift.Collection, τ_0_0.Index : Swift.Hashable>", - "sugared_genericSig": "", "implicit": true, - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", "accessorKind": "get" } ] @@ -203615,76 +203063,223 @@ } ], "declKind": "Func", - "usr": "s:s18DiscontiguousSliceV5IndexVsSHACRpzrlE4hash4intoys6HasherVz_tF", + "usr": "s:s6MirrorV12DisplayStyleO4hash4intoys6HasherVz_tF", "moduleName": "Swift", - "genericSig": "<τ_0_0 where τ_0_0 : Swift.Collection, τ_0_0.Index : Swift.Hashable>", - "sugared_genericSig": "", "implicit": true, - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", "funcSelfKind": "NonMutating" } ], - "declKind": "Struct", - "usr": "s:s18DiscontiguousSliceV5IndexV", + "declKind": "Enum", + "usr": "s:s6MirrorV12DisplayStyleO", "moduleName": "Swift", - "genericSig": "<τ_0_0 where τ_0_0 : Swift.Collection>", - "sugared_genericSig": "", - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", - "declAttributes": [ - "Frozen" - ], "conformances": [ - { - "kind": "Conformance", - "name": "Comparable", - "printedName": "Comparable", - "usr": "s:SL", - "isABIPlaceholder": true - }, { "kind": "Conformance", "name": "Equatable", "printedName": "Equatable", - "usr": "s:SQ", - "isABIPlaceholder": true + "usr": "s:SQ" }, { "kind": "Conformance", "name": "Hashable", "printedName": "Hashable", - "usr": "s:SH", - "isABIPlaceholder": true + "usr": "s:SH" } ] }, + { + "kind": "Constructor", + "name": "init", + "printedName": "init(_:children:displayStyle:ancestorRepresentation:)", + "children": [ + { + "kind": "TypeNominal", + "name": "Mirror", + "printedName": "Swift.Mirror", + "usr": "s:s6MirrorV" + }, + { + "kind": "TypeNominal", + "name": "GenericTypeParam", + "printedName": "τ_0_0" + }, + { + "kind": "TypeNominal", + "name": "GenericTypeParam", + "printedName": "τ_0_1" + }, + { + "kind": "TypeNominal", + "name": "Optional", + "printedName": "Swift.Mirror.DisplayStyle?", + "children": [ + { + "kind": "TypeNominal", + "name": "DisplayStyle", + "printedName": "Swift.Mirror.DisplayStyle", + "usr": "s:s6MirrorV12DisplayStyleO" + } + ], + "hasDefaultArg": true, + "usr": "s:Sq" + }, + { + "kind": "TypeNominal", + "name": "AncestorRepresentation", + "printedName": "Swift.Mirror.AncestorRepresentation", + "hasDefaultArg": true, + "usr": "s:s6MirrorV22AncestorRepresentationO" + } + ], + "declKind": "Constructor", + "usr": "s:s6MirrorV_8children12displayStyle22ancestorRepresentationABx_q_AB07DisplayD0OSgAB08AncestorF0OtcSlR_SSSg5label_yp5valuet7ElementRt_r0_lufc", + "moduleName": "Swift", + "genericSig": "<τ_0_0, τ_0_1 where τ_0_1 : Swift.Collection, τ_0_1.Element == (label: Swift.String?, value: Any)>", + "sugared_genericSig": "", + "init_kind": "Designated" + }, + { + "kind": "Constructor", + "name": "init", + "printedName": "init(_:unlabeledChildren:displayStyle:ancestorRepresentation:)", + "children": [ + { + "kind": "TypeNominal", + "name": "Mirror", + "printedName": "Swift.Mirror", + "usr": "s:s6MirrorV" + }, + { + "kind": "TypeNominal", + "name": "GenericTypeParam", + "printedName": "τ_0_0" + }, + { + "kind": "TypeNominal", + "name": "GenericTypeParam", + "printedName": "τ_0_1" + }, + { + "kind": "TypeNominal", + "name": "Optional", + "printedName": "Swift.Mirror.DisplayStyle?", + "children": [ + { + "kind": "TypeNominal", + "name": "DisplayStyle", + "printedName": "Swift.Mirror.DisplayStyle", + "usr": "s:s6MirrorV12DisplayStyleO" + } + ], + "hasDefaultArg": true, + "usr": "s:Sq" + }, + { + "kind": "TypeNominal", + "name": "AncestorRepresentation", + "printedName": "Swift.Mirror.AncestorRepresentation", + "hasDefaultArg": true, + "usr": "s:s6MirrorV22AncestorRepresentationO" + } + ], + "declKind": "Constructor", + "usr": "s:s6MirrorV_17unlabeledChildren12displayStyle22ancestorRepresentationABx_q_AB07DisplayE0OSgAB08AncestorG0OtcSlR_r0_lufc", + "moduleName": "Swift", + "genericSig": "<τ_0_0, τ_0_1 where τ_0_1 : Swift.Collection>", + "sugared_genericSig": "", + "init_kind": "Designated" + }, + { + "kind": "Constructor", + "name": "init", + "printedName": "init(_:children:displayStyle:ancestorRepresentation:)", + "children": [ + { + "kind": "TypeNominal", + "name": "Mirror", + "printedName": "Swift.Mirror", + "usr": "s:s6MirrorV" + }, + { + "kind": "TypeNominal", + "name": "GenericTypeParam", + "printedName": "τ_0_0" + }, + { + "kind": "TypeNominal", + "name": "KeyValuePairs", + "printedName": "Swift.KeyValuePairs", + "children": [ + { + "kind": "TypeNominal", + "name": "String", + "printedName": "Swift.String", + "usr": "s:SS" + }, + { + "kind": "TypeNominal", + "name": "ProtocolComposition", + "printedName": "Any" + } + ], + "usr": "s:s13KeyValuePairsV" + }, + { + "kind": "TypeNominal", + "name": "Optional", + "printedName": "Swift.Mirror.DisplayStyle?", + "children": [ + { + "kind": "TypeNominal", + "name": "DisplayStyle", + "printedName": "Swift.Mirror.DisplayStyle", + "usr": "s:s6MirrorV12DisplayStyleO" + } + ], + "hasDefaultArg": true, + "usr": "s:Sq" + }, + { + "kind": "TypeNominal", + "name": "AncestorRepresentation", + "printedName": "Swift.Mirror.AncestorRepresentation", + "hasDefaultArg": true, + "usr": "s:s6MirrorV22AncestorRepresentationO" + } + ], + "declKind": "Constructor", + "usr": "s:s6MirrorV_8children12displayStyle22ancestorRepresentationABx_s13KeyValuePairsVySSypGAB07DisplayD0OSgAB08AncestorF0Otclufc", + "moduleName": "Swift", + "genericSig": "<τ_0_0>", + "sugared_genericSig": "", + "init_kind": "Designated" + }, { "kind": "Var", - "name": "startIndex", - "printedName": "startIndex", + "name": "subjectType", + "printedName": "subjectType", "children": [ { "kind": "TypeNominal", - "name": "Index", - "printedName": "Swift.DiscontiguousSlice<τ_0_0>.Index", - "usr": "s:s18DiscontiguousSliceV5IndexV" + "name": "ExistentialMetatype", + "printedName": "any Any.Type", + "children": [ + { + "kind": "TypeNominal", + "name": "ProtocolComposition", + "printedName": "Any" + } + ] } ], "declKind": "Var", - "usr": "s:s18DiscontiguousSliceV10startIndexAB0D0Vyx_Gvp", + "usr": "s:s6MirrorV11subjectTypeypXpvp", "moduleName": "Swift", - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", + "declAttributes": [ + "HasStorage" + ], + "isLet": true, + "hasStorage": true, "accessors": [ { "kind": "Accessor", @@ -203693,45 +203288,73 @@ "children": [ { "kind": "TypeNominal", - "name": "Index", - "printedName": "Swift.DiscontiguousSlice<τ_0_0>.Index", - "usr": "s:s18DiscontiguousSliceV5IndexV" + "name": "ExistentialMetatype", + "printedName": "any Any.Type", + "children": [ + { + "kind": "TypeNominal", + "name": "ProtocolComposition", + "printedName": "Any" + } + ] } ], "declKind": "Accessor", - "usr": "s:s18DiscontiguousSliceV10startIndexAB0D0Vyx_Gvg", + "usr": "s:s6MirrorV11subjectTypeypXpvg", "moduleName": "Swift", - "genericSig": "<τ_0_0 where τ_0_0 : Swift.Collection>", - "sugared_genericSig": "", - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", + "implicit": true, "accessorKind": "get" } ] }, { "kind": "Var", - "name": "endIndex", - "printedName": "endIndex", + "name": "children", + "printedName": "children", "children": [ { "kind": "TypeNominal", - "name": "Index", - "printedName": "Swift.DiscontiguousSlice<τ_0_0>.Index", - "usr": "s:s18DiscontiguousSliceV5IndexV" + "name": "AnyCollection", + "printedName": "Swift.AnyCollection<(label: Swift.String?, value: Any)>", + "children": [ + { + "kind": "TypeNominal", + "name": "Tuple", + "printedName": "(label: Swift.String?, value: Any)", + "children": [ + { + "kind": "TypeNominal", + "name": "Optional", + "printedName": "Swift.String?", + "children": [ + { + "kind": "TypeNominal", + "name": "String", + "printedName": "Swift.String", + "usr": "s:SS" + } + ], + "usr": "s:Sq" + }, + { + "kind": "TypeNominal", + "name": "ProtocolComposition", + "printedName": "Any" + } + ] + } + ], + "usr": "s:s13AnyCollectionV" } ], "declKind": "Var", - "usr": "s:s18DiscontiguousSliceV8endIndexAB0D0Vyx_Gvp", + "usr": "s:s6MirrorV8childrens13AnyCollectionVySSSg5label_yp5valuetGvp", "moduleName": "Swift", - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", + "declAttributes": [ + "HasStorage" + ], + "isLet": true, + "hasStorage": true, "accessors": [ { "kind": "Accessor", @@ -203740,82 +203363,127 @@ "children": [ { "kind": "TypeNominal", - "name": "Index", - "printedName": "Swift.DiscontiguousSlice<τ_0_0>.Index", - "usr": "s:s18DiscontiguousSliceV5IndexV" + "name": "AnyCollection", + "printedName": "Swift.AnyCollection<(label: Swift.String?, value: Any)>", + "children": [ + { + "kind": "TypeNominal", + "name": "Tuple", + "printedName": "(label: Swift.String?, value: Any)", + "children": [ + { + "kind": "TypeNominal", + "name": "Optional", + "printedName": "Swift.String?", + "children": [ + { + "kind": "TypeNominal", + "name": "String", + "printedName": "Swift.String", + "usr": "s:SS" + } + ], + "usr": "s:Sq" + }, + { + "kind": "TypeNominal", + "name": "ProtocolComposition", + "printedName": "Any" + } + ] + } + ], + "usr": "s:s13AnyCollectionV" } ], "declKind": "Accessor", - "usr": "s:s18DiscontiguousSliceV8endIndexAB0D0Vyx_Gvg", + "usr": "s:s6MirrorV8childrens13AnyCollectionVySSSg5label_yp5valuetGvg", "moduleName": "Swift", - "genericSig": "<τ_0_0 where τ_0_0 : Swift.Collection>", - "sugared_genericSig": "", - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", + "implicit": true, "accessorKind": "get" } ] }, { - "kind": "Function", - "name": "index", - "printedName": "index(after:)", + "kind": "Var", + "name": "displayStyle", + "printedName": "displayStyle", "children": [ { "kind": "TypeNominal", - "name": "Index", - "printedName": "Swift.DiscontiguousSlice<τ_0_0>.Index", - "usr": "s:s18DiscontiguousSliceV5IndexV" - }, - { - "kind": "TypeNominal", - "name": "Index", - "printedName": "Swift.DiscontiguousSlice<τ_0_0>.Index", - "usr": "s:s18DiscontiguousSliceV5IndexV" + "name": "Optional", + "printedName": "Swift.Mirror.DisplayStyle?", + "children": [ + { + "kind": "TypeNominal", + "name": "DisplayStyle", + "printedName": "Swift.Mirror.DisplayStyle", + "usr": "s:s6MirrorV12DisplayStyleO" + } + ], + "usr": "s:Sq" } ], - "declKind": "Func", - "usr": "s:s18DiscontiguousSliceV5index5afterAB5IndexVyx_GAG_tF", + "declKind": "Var", + "usr": "s:s6MirrorV12displayStyleAB07DisplayC0OSgvp", "moduleName": "Swift", - "genericSig": "<τ_0_0 where τ_0_0 : Swift.Collection>", - "sugared_genericSig": "", - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", - "funcSelfKind": "NonMutating" + "declAttributes": [ + "HasStorage" + ], + "isLet": true, + "hasStorage": true, + "accessors": [ + { + "kind": "Accessor", + "name": "Get", + "printedName": "Get()", + "children": [ + { + "kind": "TypeNominal", + "name": "Optional", + "printedName": "Swift.Mirror.DisplayStyle?", + "children": [ + { + "kind": "TypeNominal", + "name": "DisplayStyle", + "printedName": "Swift.Mirror.DisplayStyle", + "usr": "s:s6MirrorV12DisplayStyleO" + } + ], + "usr": "s:Sq" + } + ], + "declKind": "Accessor", + "usr": "s:s6MirrorV12displayStyleAB07DisplayC0OSgvg", + "moduleName": "Swift", + "implicit": true, + "accessorKind": "get" + } + ] }, { - "kind": "Subscript", - "name": "subscript", - "printedName": "subscript(_:)", + "kind": "Var", + "name": "superclassMirror", + "printedName": "superclassMirror", "children": [ { "kind": "TypeNominal", - "name": "DependentMember", - "printedName": "τ_0_0.Element" - }, - { - "kind": "TypeNominal", - "name": "Index", - "printedName": "Swift.DiscontiguousSlice<τ_0_0>.Index", - "usr": "s:s18DiscontiguousSliceV5IndexV" + "name": "Optional", + "printedName": "Swift.Mirror?", + "children": [ + { + "kind": "TypeNominal", + "name": "Mirror", + "printedName": "Swift.Mirror", + "usr": "s:s6MirrorV" + } + ], + "usr": "s:Sq" } ], - "declKind": "Subscript", - "usr": "s:s18DiscontiguousSliceVy7ElementQzAB5IndexVyx_Gcip", + "declKind": "Var", + "usr": "s:s6MirrorV010superclassA0ABSgvp", "moduleName": "Swift", - "genericSig": "<τ_0_0 where τ_0_0 : Swift.Collection>", - "sugared_genericSig": "", - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", "accessors": [ { "kind": "Accessor", @@ -203824,73 +203492,85 @@ "children": [ { "kind": "TypeNominal", - "name": "DependentMember", - "printedName": "τ_0_0.Element" - }, - { - "kind": "TypeNominal", - "name": "Index", - "printedName": "Swift.DiscontiguousSlice<τ_0_0>.Index", - "usr": "s:s18DiscontiguousSliceV5IndexV" + "name": "Optional", + "printedName": "Swift.Mirror?", + "children": [ + { + "kind": "TypeNominal", + "name": "Mirror", + "printedName": "Swift.Mirror", + "usr": "s:s6MirrorV" + } + ], + "usr": "s:Sq" } ], "declKind": "Accessor", - "usr": "s:s18DiscontiguousSliceVy7ElementQzAB5IndexVyx_Gcig", + "usr": "s:s6MirrorV010superclassA0ABSgvg", "moduleName": "Swift", - "genericSig": "<τ_0_0 where τ_0_0 : Swift.Collection>", - "sugared_genericSig": "", - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", "accessorKind": "get" } ] }, { - "kind": "Subscript", - "name": "subscript", - "printedName": "subscript(_:)", + "kind": "Function", + "name": "descendant", + "printedName": "descendant(_:_:)", "children": [ { "kind": "TypeNominal", - "name": "DiscontiguousSlice", - "printedName": "Swift.DiscontiguousSlice<τ_0_0>", + "name": "Optional", + "printedName": "Any?", "children": [ { "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "τ_0_0" + "name": "ProtocolComposition", + "printedName": "Any" } ], - "usr": "s:s18DiscontiguousSliceV" + "usr": "s:Sq" }, { "kind": "TypeNominal", - "name": "Range", - "printedName": "Swift.Range.Index>", + "name": "MirrorPath", + "printedName": "any Swift.MirrorPath", + "usr": "s:s10MirrorPathP" + }, + { + "kind": "TypeNominal", + "name": "Array", + "printedName": "[any Swift.MirrorPath]", "children": [ { "kind": "TypeNominal", - "name": "Index", - "printedName": "Swift.DiscontiguousSlice<τ_0_0>.Index", - "usr": "s:s18DiscontiguousSliceV5IndexV" + "name": "MirrorPath", + "printedName": "any Swift.MirrorPath", + "usr": "s:s10MirrorPathP" } ], - "usr": "s:Sn" + "usr": "s:Sa" } ], - "declKind": "Subscript", - "usr": "s:s18DiscontiguousSliceVyAByxGSnyAB5IndexVyx_GGcip", + "declKind": "Func", + "usr": "s:s6MirrorV10descendantyypSgs0A4Path_p_sAE_pdtF", + "moduleName": "Swift", + "funcSelfKind": "NonMutating" + }, + { + "kind": "Var", + "name": "description", + "printedName": "description", + "children": [ + { + "kind": "TypeNominal", + "name": "String", + "printedName": "Swift.String", + "usr": "s:SS" + } + ], + "declKind": "Var", + "usr": "s:s6MirrorV11descriptionSSvp", "moduleName": "Swift", - "genericSig": "<τ_0_0 where τ_0_0 : Swift.Collection>", - "sugared_genericSig": "", - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", "accessors": [ { "kind": "Accessor", @@ -203899,66 +203579,33 @@ "children": [ { "kind": "TypeNominal", - "name": "DiscontiguousSlice", - "printedName": "Swift.DiscontiguousSlice<τ_0_0>", - "children": [ - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "τ_0_0" - } - ], - "usr": "s:s18DiscontiguousSliceV" - }, - { - "kind": "TypeNominal", - "name": "Range", - "printedName": "Swift.Range.Index>", - "children": [ - { - "kind": "TypeNominal", - "name": "Index", - "printedName": "Swift.DiscontiguousSlice<τ_0_0>.Index", - "usr": "s:s18DiscontiguousSliceV5IndexV" - } - ], - "usr": "s:Sn" + "name": "String", + "printedName": "Swift.String", + "usr": "s:SS" } ], "declKind": "Accessor", - "usr": "s:s18DiscontiguousSliceVyAByxGSnyAB5IndexVyx_GGcig", + "usr": "s:s6MirrorV11descriptionSSvg", "moduleName": "Swift", - "genericSig": "<τ_0_0 where τ_0_0 : Swift.Collection>", - "sugared_genericSig": "", - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", "accessorKind": "get" } ] }, { "kind": "Var", - "name": "count", - "printedName": "count", + "name": "customMirror", + "printedName": "customMirror", "children": [ { "kind": "TypeNominal", - "name": "Int", - "printedName": "Swift.Int", - "usr": "s:Si" + "name": "Mirror", + "printedName": "Swift.Mirror", + "usr": "s:s6MirrorV" } ], "declKind": "Var", - "usr": "s:s18DiscontiguousSliceV5countSivp", + "usr": "s:s6MirrorV06customA0ABvp", "moduleName": "Swift", - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", "accessors": [ { "kind": "Accessor", @@ -203967,113 +203614,188 @@ "children": [ { "kind": "TypeNominal", - "name": "Int", - "printedName": "Swift.Int", - "usr": "s:Si" + "name": "Mirror", + "printedName": "Swift.Mirror", + "usr": "s:s6MirrorV" } ], "declKind": "Accessor", - "usr": "s:s18DiscontiguousSliceV5countSivg", + "usr": "s:s6MirrorV06customA0ABvg", "moduleName": "Swift", - "genericSig": "<τ_0_0 where τ_0_0 : Swift.Collection>", - "sugared_genericSig": "", - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", "accessorKind": "get" } ] + } + ], + "declKind": "Struct", + "usr": "s:s6MirrorV", + "moduleName": "Swift", + "conformances": [ + { + "kind": "Conformance", + "name": "CustomStringConvertible", + "printedName": "CustomStringConvertible", + "usr": "s:s23CustomStringConvertibleP" }, { - "kind": "Function", - "name": "_copyToContiguousArray", - "printedName": "_copyToContiguousArray()", + "kind": "Conformance", + "name": "CustomReflectable", + "printedName": "CustomReflectable", + "usr": "s:s17CustomReflectableP" + } + ] + }, + { + "kind": "TypeDecl", + "name": "CustomReflectable", + "printedName": "CustomReflectable", + "children": [ + { + "kind": "Var", + "name": "customMirror", + "printedName": "customMirror", "children": [ { "kind": "TypeNominal", - "name": "ContiguousArray", - "printedName": "Swift.ContiguousArray<τ_0_0.Element>", + "name": "Mirror", + "printedName": "Swift.Mirror", + "usr": "s:s6MirrorV" + } + ], + "declKind": "Var", + "usr": "s:s17CustomReflectableP12customMirrors0D0Vvp", + "moduleName": "Swift", + "protocolReq": true, + "accessors": [ + { + "kind": "Accessor", + "name": "Get", + "printedName": "Get()", "children": [ { "kind": "TypeNominal", - "name": "DependentMember", - "printedName": "τ_0_0.Element" + "name": "Mirror", + "printedName": "Swift.Mirror", + "usr": "s:s6MirrorV" } ], - "usr": "s:s15ContiguousArrayV" + "declKind": "Accessor", + "usr": "s:s17CustomReflectableP12customMirrors0D0Vvg", + "moduleName": "Swift", + "genericSig": "<τ_0_0 where τ_0_0 : Swift.CustomReflectable>", + "sugared_genericSig": "", + "protocolReq": true, + "reqNewWitnessTableEntry": true, + "accessorKind": "get" } - ], - "declKind": "Func", - "usr": "s:s18DiscontiguousSliceV22_copyToContiguousArrays0eF0Vy7ElementQzGyF", - "moduleName": "Swift", - "genericSig": "<τ_0_0 where τ_0_0 : Swift.Collection>", - "sugared_genericSig": "", - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", - "funcSelfKind": "__Consuming" - }, + ] + } + ], + "declKind": "Protocol", + "usr": "s:s17CustomReflectableP", + "moduleName": "Swift" + }, + { + "kind": "TypeDecl", + "name": "CustomLeafReflectable", + "printedName": "CustomLeafReflectable", + "declKind": "Protocol", + "usr": "s:s21CustomLeafReflectableP", + "moduleName": "Swift", + "genericSig": "<τ_0_0 : Swift.CustomReflectable>", + "sugared_genericSig": "", + "conformances": [ { - "kind": "Function", - "name": "index", - "printedName": "index(before:)", + "kind": "Conformance", + "name": "CustomReflectable", + "printedName": "CustomReflectable", + "usr": "s:s17CustomReflectableP" + } + ] + }, + { + "kind": "TypeDecl", + "name": "MirrorPath", + "printedName": "MirrorPath", + "declKind": "Protocol", + "usr": "s:s10MirrorPathP", + "moduleName": "Swift" + }, + { + "kind": "TypeDecl", + "name": "CustomPlaygroundDisplayConvertible", + "printedName": "CustomPlaygroundDisplayConvertible", + "children": [ + { + "kind": "Var", + "name": "playgroundDescription", + "printedName": "playgroundDescription", "children": [ { "kind": "TypeNominal", - "name": "Index", - "printedName": "Swift.DiscontiguousSlice<τ_0_0>.Index", - "usr": "s:s18DiscontiguousSliceV5IndexV" - }, - { - "kind": "TypeNominal", - "name": "Index", - "printedName": "Swift.DiscontiguousSlice<τ_0_0>.Index", - "usr": "s:s18DiscontiguousSliceV5IndexV" + "name": "ProtocolComposition", + "printedName": "Any" } ], - "declKind": "Func", - "usr": "s:s18DiscontiguousSliceVsSKRzrlE5index6beforeAB5IndexVyx_GAG_tF", + "declKind": "Var", + "usr": "s:s34CustomPlaygroundDisplayConvertibleP21playgroundDescriptionypvp", "moduleName": "Swift", - "genericSig": "<τ_0_0 where τ_0_0 : Swift.BidirectionalCollection>", - "sugared_genericSig": "", - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", - "funcSelfKind": "NonMutating" - }, + "protocolReq": true, + "accessors": [ + { + "kind": "Accessor", + "name": "Get", + "printedName": "Get()", + "children": [ + { + "kind": "TypeNominal", + "name": "ProtocolComposition", + "printedName": "Any" + } + ], + "declKind": "Accessor", + "usr": "s:s34CustomPlaygroundDisplayConvertibleP21playgroundDescriptionypvg", + "moduleName": "Swift", + "genericSig": "<τ_0_0 where τ_0_0 : Swift.CustomPlaygroundDisplayConvertible>", + "sugared_genericSig": "", + "protocolReq": true, + "reqNewWitnessTableEntry": true, + "accessorKind": "get" + } + ] + } + ], + "declKind": "Protocol", + "usr": "s:s34CustomPlaygroundDisplayConvertibleP", + "moduleName": "Swift" + }, + { + "kind": "TypeDecl", + "name": "CommandLine", + "printedName": "CommandLine", + "children": [ { - "kind": "Subscript", - "name": "subscript", - "printedName": "subscript(_:)", + "kind": "Var", + "name": "_argc", + "printedName": "_argc", "children": [ { "kind": "TypeNominal", - "name": "DependentMember", - "printedName": "τ_0_0.Element" - }, - { - "kind": "TypeNominal", - "name": "Index", - "printedName": "Swift.DiscontiguousSlice<τ_0_0>.Index", - "usr": "s:s18DiscontiguousSliceV5IndexV" + "name": "Int32", + "printedName": "Swift.Int32", + "usr": "s:s5Int32V" } ], - "declKind": "Subscript", - "usr": "s:s18DiscontiguousSliceVsSMRzrlEy7ElementQzAB5IndexVyx_Gcip", + "declKind": "Var", + "usr": "s:s11CommandLineO5_argcs5Int32VvpZ", "moduleName": "Swift", - "genericSig": "<τ_0_0 where τ_0_0 : Swift.MutableCollection>", - "sugared_genericSig": "", - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", + "static": true, + "declAttributes": [ + "HasInitialValue", + "UsableFromInline", + "HasStorage" + ], + "hasStorage": true, "accessors": [ { "kind": "Accessor", @@ -204082,26 +203804,16 @@ "children": [ { "kind": "TypeNominal", - "name": "DependentMember", - "printedName": "τ_0_0.Element" - }, - { - "kind": "TypeNominal", - "name": "Index", - "printedName": "Swift.DiscontiguousSlice<τ_0_0>.Index", - "usr": "s:s18DiscontiguousSliceV5IndexV" + "name": "Int32", + "printedName": "Swift.Int32", + "usr": "s:s5Int32V" } ], "declKind": "Accessor", - "usr": "s:s18DiscontiguousSliceVsSMRzrlEy7ElementQzAB5IndexVyx_Gcig", + "usr": "s:s11CommandLineO5_argcs5Int32VvgZ", "moduleName": "Swift", - "genericSig": "<τ_0_0 where τ_0_0 : Swift.MutableCollection>", - "sugared_genericSig": "", - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", + "static": true, + "implicit": true, "accessorKind": "get" }, { @@ -204116,26 +203828,16 @@ }, { "kind": "TypeNominal", - "name": "DependentMember", - "printedName": "τ_0_0.Element" - }, - { - "kind": "TypeNominal", - "name": "Index", - "printedName": "Swift.DiscontiguousSlice<τ_0_0>.Index", - "usr": "s:s18DiscontiguousSliceV5IndexV" + "name": "Int32", + "printedName": "Swift.Int32", + "usr": "s:s5Int32V" } ], "declKind": "Accessor", - "usr": "s:s18DiscontiguousSliceVsSMRzrlEy7ElementQzAB5IndexVyx_Gcis", + "usr": "s:s11CommandLineO5_argcs5Int32VvsZ", "moduleName": "Swift", - "genericSig": "<τ_0_0 where τ_0_0 : Swift.MutableCollection>", - "sugared_genericSig": "", - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", + "static": true, + "implicit": true, "accessorKind": "set" }, { @@ -204147,1114 +203849,325 @@ "kind": "TypeNominal", "name": "Void", "printedName": "()" - }, - { - "kind": "TypeNominal", - "name": "Index", - "printedName": "Swift.DiscontiguousSlice<τ_0_0>.Index", - "usr": "s:s18DiscontiguousSliceV5IndexV" } ], "declKind": "Accessor", - "usr": "s:s18DiscontiguousSliceVsSMRzrlEy7ElementQzAB5IndexVyx_GciM", + "usr": "s:s11CommandLineO5_argcs5Int32VvMZ", "moduleName": "Swift", - "genericSig": "<τ_0_0 where τ_0_0 : Swift.MutableCollection>", - "sugared_genericSig": "", + "static": true, "implicit": true, - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", - "declAttributes": [ - "Transparent" - ], "accessorKind": "_modify" } ] - } - ], - "declKind": "Struct", - "usr": "s:s18DiscontiguousSliceV", - "moduleName": "Swift", - "genericSig": "<τ_0_0 where τ_0_0 : Swift.Collection>", - "sugared_genericSig": "", - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", - "declAttributes": [ - "Frozen", - "Available", - "Available", - "Available", - "Available" - ], - "conformances": [ + }, { - "kind": "Conformance", - "name": "Collection", - "printedName": "Collection", + "kind": "Var", + "name": "_unsafeArgv", + "printedName": "_unsafeArgv", "children": [ { - "kind": "TypeWitness", - "name": "Element", - "printedName": "Element", - "children": [ - { - "kind": "TypeNominal", - "name": "DependentMember", - "printedName": "τ_0_0.Element" - } - ] - }, - { - "kind": "TypeWitness", - "name": "Index", - "printedName": "Index", - "children": [ - { - "kind": "TypeNominal", - "name": "Index", - "printedName": "Swift.DiscontiguousSlice<τ_0_0>.Index", - "usr": "s:s18DiscontiguousSliceV5IndexV" - } - ] - }, - { - "kind": "TypeWitness", - "name": "Iterator", - "printedName": "Iterator", + "kind": "TypeNominal", + "name": "UnsafeMutablePointer", + "printedName": "Swift.UnsafeMutablePointer?>", "children": [ { "kind": "TypeNominal", - "name": "IndexingIterator", - "printedName": "Swift.IndexingIterator>", + "name": "Optional", + "printedName": "Swift.UnsafeMutablePointer?", "children": [ { "kind": "TypeNominal", - "name": "DiscontiguousSlice", - "printedName": "Swift.DiscontiguousSlice<τ_0_0>", + "name": "UnsafeMutablePointer", + "printedName": "Swift.UnsafeMutablePointer", "children": [ { "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "τ_0_0" + "name": "Int8", + "printedName": "Swift.Int8", + "usr": "s:s4Int8V" } ], - "usr": "s:s18DiscontiguousSliceV" + "usr": "s:Sp" } ], - "usr": "s:s16IndexingIteratorV" + "usr": "s:Sq" } - ] - }, + ], + "usr": "s:Sp" + } + ], + "declKind": "Var", + "usr": "s:s11CommandLineO11_unsafeArgvSpySpys4Int8VGSgGvpZ", + "moduleName": "Swift", + "static": true, + "declAttributes": [ + "HasInitialValue", + "UsableFromInline", + "HasStorage" + ], + "hasStorage": true, + "accessors": [ { - "kind": "TypeWitness", - "name": "SubSequence", - "printedName": "SubSequence", + "kind": "Accessor", + "name": "Get", + "printedName": "Get()", "children": [ { "kind": "TypeNominal", - "name": "DiscontiguousSlice", - "printedName": "Swift.DiscontiguousSlice<τ_0_0>", + "name": "UnsafeMutablePointer", + "printedName": "Swift.UnsafeMutablePointer?>", "children": [ { "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "τ_0_0" + "name": "Optional", + "printedName": "Swift.UnsafeMutablePointer?", + "children": [ + { + "kind": "TypeNominal", + "name": "UnsafeMutablePointer", + "printedName": "Swift.UnsafeMutablePointer", + "children": [ + { + "kind": "TypeNominal", + "name": "Int8", + "printedName": "Swift.Int8", + "usr": "s:s4Int8V" + } + ], + "usr": "s:Sp" + } + ], + "usr": "s:Sq" } ], - "usr": "s:s18DiscontiguousSliceV" + "usr": "s:Sp" } - ] + ], + "declKind": "Accessor", + "usr": "s:s11CommandLineO11_unsafeArgvSpySpys4Int8VGSgGvgZ", + "moduleName": "Swift", + "static": true, + "implicit": true, + "accessorKind": "get" }, { - "kind": "TypeWitness", - "name": "Indices", - "printedName": "Indices", + "kind": "Accessor", + "name": "Set", + "printedName": "Set()", "children": [ { "kind": "TypeNominal", - "name": "DefaultIndices", - "printedName": "Swift.DefaultIndices>", + "name": "Void", + "printedName": "()" + }, + { + "kind": "TypeNominal", + "name": "UnsafeMutablePointer", + "printedName": "Swift.UnsafeMutablePointer?>", "children": [ { "kind": "TypeNominal", - "name": "DiscontiguousSlice", - "printedName": "Swift.DiscontiguousSlice<τ_0_0>", + "name": "Optional", + "printedName": "Swift.UnsafeMutablePointer?", "children": [ { "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "τ_0_0" + "name": "UnsafeMutablePointer", + "printedName": "Swift.UnsafeMutablePointer", + "children": [ + { + "kind": "TypeNominal", + "name": "Int8", + "printedName": "Swift.Int8", + "usr": "s:s4Int8V" + } + ], + "usr": "s:Sp" } ], - "usr": "s:s18DiscontiguousSliceV" + "usr": "s:Sq" } ], - "usr": "s:SI" + "usr": "s:Sp" } - ] + ], + "declKind": "Accessor", + "usr": "s:s11CommandLineO11_unsafeArgvSpySpys4Int8VGSgGvsZ", + "moduleName": "Swift", + "static": true, + "implicit": true, + "accessorKind": "set" + }, + { + "kind": "Accessor", + "name": "Modify", + "printedName": "Modify()", + "children": [ + { + "kind": "TypeNominal", + "name": "Void", + "printedName": "()" + } + ], + "declKind": "Accessor", + "usr": "s:s11CommandLineO11_unsafeArgvSpySpys4Int8VGSgGvMZ", + "moduleName": "Swift", + "static": true, + "implicit": true, + "accessorKind": "_modify" } - ], - "usr": "s:Sl", - "isABIPlaceholder": true + ] }, { - "kind": "Conformance", - "name": "Sequence", - "printedName": "Sequence", + "kind": "Var", + "name": "argc", + "printedName": "argc", "children": [ { - "kind": "TypeWitness", - "name": "Element", - "printedName": "Element", + "kind": "TypeNominal", + "name": "Int32", + "printedName": "Swift.Int32", + "usr": "s:s5Int32V" + } + ], + "declKind": "Var", + "usr": "s:s11CommandLineO4argcs5Int32VvpZ", + "moduleName": "Swift", + "static": true, + "accessors": [ + { + "kind": "Accessor", + "name": "Get", + "printedName": "Get()", "children": [ { "kind": "TypeNominal", - "name": "DependentMember", - "printedName": "τ_0_0.Element" + "name": "Int32", + "printedName": "Swift.Int32", + "usr": "s:s5Int32V" } - ] - }, + ], + "declKind": "Accessor", + "usr": "s:s11CommandLineO4argcs5Int32VvgZ", + "moduleName": "Swift", + "static": true, + "accessorKind": "get" + } + ] + }, + { + "kind": "Var", + "name": "unsafeArgv", + "printedName": "unsafeArgv", + "children": [ { - "kind": "TypeWitness", - "name": "Iterator", - "printedName": "Iterator", + "kind": "TypeNominal", + "name": "UnsafeMutablePointer", + "printedName": "Swift.UnsafeMutablePointer?>", "children": [ { "kind": "TypeNominal", - "name": "IndexingIterator", - "printedName": "Swift.IndexingIterator>", + "name": "Optional", + "printedName": "Swift.UnsafeMutablePointer?", "children": [ { "kind": "TypeNominal", - "name": "DiscontiguousSlice", - "printedName": "Swift.DiscontiguousSlice<τ_0_0>", + "name": "UnsafeMutablePointer", + "printedName": "Swift.UnsafeMutablePointer", "children": [ { "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "τ_0_0" + "name": "Int8", + "printedName": "Swift.Int8", + "usr": "s:s4Int8V" } ], - "usr": "s:s18DiscontiguousSliceV" + "usr": "s:Sp" } ], - "usr": "s:s16IndexingIteratorV" + "usr": "s:Sq" } - ] - } - ], - "usr": "s:ST", - "isABIPlaceholder": true - }, - { - "kind": "Conformance", - "name": "BidirectionalCollection", - "printedName": "BidirectionalCollection", - "children": [ - { - "kind": "TypeWitness", - "name": "Element", - "printedName": "Element", - "children": [ - { - "kind": "TypeNominal", - "name": "DependentMember", - "printedName": "τ_0_0.Element" - } - ] - }, - { - "kind": "TypeWitness", - "name": "Index", - "printedName": "Index", - "children": [ - { - "kind": "TypeNominal", - "name": "Index", - "printedName": "Swift.DiscontiguousSlice<τ_0_0>.Index", - "usr": "s:s18DiscontiguousSliceV5IndexV" - } - ] - }, - { - "kind": "TypeWitness", - "name": "SubSequence", - "printedName": "SubSequence", - "children": [ - { - "kind": "TypeNominal", - "name": "DiscontiguousSlice", - "printedName": "Swift.DiscontiguousSlice<τ_0_0>", - "children": [ - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "τ_0_0" - } - ], - "usr": "s:s18DiscontiguousSliceV" - } - ] - }, - { - "kind": "TypeWitness", - "name": "Indices", - "printedName": "Indices", - "children": [ - { - "kind": "TypeNominal", - "name": "DefaultIndices", - "printedName": "Swift.DefaultIndices>", - "children": [ - { - "kind": "TypeNominal", - "name": "DiscontiguousSlice", - "printedName": "Swift.DiscontiguousSlice<τ_0_0>", - "children": [ - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "τ_0_0" - } - ], - "usr": "s:s18DiscontiguousSliceV" - } - ], - "usr": "s:SI" - } - ] + ], + "usr": "s:Sp" } ], - "usr": "s:SK", - "isABIPlaceholder": true - }, - { - "kind": "Conformance", - "name": "MutableCollection", - "printedName": "MutableCollection", - "children": [ - { - "kind": "TypeWitness", - "name": "Element", - "printedName": "Element", - "children": [ - { - "kind": "TypeNominal", - "name": "DependentMember", - "printedName": "τ_0_0.Element" - } - ] - }, - { - "kind": "TypeWitness", - "name": "Index", - "printedName": "Index", - "children": [ - { - "kind": "TypeNominal", - "name": "Index", - "printedName": "Swift.DiscontiguousSlice<τ_0_0>.Index", - "usr": "s:s18DiscontiguousSliceV5IndexV" - } - ] - }, + "declKind": "Var", + "usr": "s:s11CommandLineO10unsafeArgvSpySpys4Int8VGSgGvpZ", + "moduleName": "Swift", + "static": true, + "accessors": [ { - "kind": "TypeWitness", - "name": "SubSequence", - "printedName": "SubSequence", + "kind": "Accessor", + "name": "Get", + "printedName": "Get()", "children": [ { "kind": "TypeNominal", - "name": "DiscontiguousSlice", - "printedName": "Swift.DiscontiguousSlice<τ_0_0>", - "children": [ - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "τ_0_0" - } - ], - "usr": "s:s18DiscontiguousSliceV" - } - ] - } - ], - "usr": "s:SM", - "isABIPlaceholder": true - } - ] - }, - { - "kind": "TypeDecl", - "name": "Mirror", - "printedName": "Mirror", - "children": [ - { - "kind": "TypeDecl", - "name": "AncestorRepresentation", - "printedName": "AncestorRepresentation", - "children": [ - { - "kind": "Var", - "name": "generated", - "printedName": "generated", - "children": [ - { - "kind": "TypeFunc", - "name": "Function", - "printedName": "(Swift.Mirror.AncestorRepresentation.Type) -> Swift.Mirror.AncestorRepresentation", + "name": "UnsafeMutablePointer", + "printedName": "Swift.UnsafeMutablePointer?>", "children": [ { "kind": "TypeNominal", - "name": "AncestorRepresentation", - "printedName": "Swift.Mirror.AncestorRepresentation", - "usr": "s:s6MirrorV22AncestorRepresentationO" - }, - { - "kind": "TypeNominal", - "name": "Metatype", - "printedName": "Swift.Mirror.AncestorRepresentation.Type", - "children": [ - { - "kind": "TypeNominal", - "name": "AncestorRepresentation", - "printedName": "Swift.Mirror.AncestorRepresentation", - "usr": "s:s6MirrorV22AncestorRepresentationO" - } - ] - } - ] - } - ], - "declKind": "EnumElement", - "usr": "s:s6MirrorV22AncestorRepresentationO9generatedyA2DmF", - "moduleName": "Swift" - }, - { - "kind": "Var", - "name": "customized", - "printedName": "customized", - "children": [ - { - "kind": "TypeFunc", - "name": "Function", - "printedName": "(Swift.Mirror.AncestorRepresentation.Type) -> (@escaping () -> Swift.Mirror) -> Swift.Mirror.AncestorRepresentation", - "children": [ - { - "kind": "TypeFunc", - "name": "Function", - "printedName": "(@escaping () -> Swift.Mirror) -> Swift.Mirror.AncestorRepresentation", + "name": "Optional", + "printedName": "Swift.UnsafeMutablePointer?", "children": [ { "kind": "TypeNominal", - "name": "AncestorRepresentation", - "printedName": "Swift.Mirror.AncestorRepresentation", - "usr": "s:s6MirrorV22AncestorRepresentationO" - }, - { - "kind": "TypeFunc", - "name": "Function", - "printedName": "() -> Swift.Mirror", + "name": "UnsafeMutablePointer", + "printedName": "Swift.UnsafeMutablePointer", "children": [ { "kind": "TypeNominal", - "name": "Mirror", - "printedName": "Swift.Mirror", - "usr": "s:s6MirrorV" - }, - { - "kind": "TypeNominal", - "name": "Void", - "printedName": "()" + "name": "Int8", + "printedName": "Swift.Int8", + "usr": "s:s4Int8V" } - ] - } - ] - }, - { - "kind": "TypeNominal", - "name": "Metatype", - "printedName": "Swift.Mirror.AncestorRepresentation.Type", - "children": [ - { - "kind": "TypeNominal", - "name": "AncestorRepresentation", - "printedName": "Swift.Mirror.AncestorRepresentation", - "usr": "s:s6MirrorV22AncestorRepresentationO" - } - ] - } - ] - } - ], - "declKind": "EnumElement", - "usr": "s:s6MirrorV22AncestorRepresentationO10customizedyAdByccADmF", - "moduleName": "Swift" - }, - { - "kind": "Var", - "name": "suppressed", - "printedName": "suppressed", - "children": [ - { - "kind": "TypeFunc", - "name": "Function", - "printedName": "(Swift.Mirror.AncestorRepresentation.Type) -> Swift.Mirror.AncestorRepresentation", - "children": [ - { - "kind": "TypeNominal", - "name": "AncestorRepresentation", - "printedName": "Swift.Mirror.AncestorRepresentation", - "usr": "s:s6MirrorV22AncestorRepresentationO" - }, - { - "kind": "TypeNominal", - "name": "Metatype", - "printedName": "Swift.Mirror.AncestorRepresentation.Type", - "children": [ - { - "kind": "TypeNominal", - "name": "AncestorRepresentation", - "printedName": "Swift.Mirror.AncestorRepresentation", - "usr": "s:s6MirrorV22AncestorRepresentationO" - } - ] - } - ] - } - ], - "declKind": "EnumElement", - "usr": "s:s6MirrorV22AncestorRepresentationO10suppressedyA2DmF", - "moduleName": "Swift" - } - ], - "declKind": "Enum", - "usr": "s:s6MirrorV22AncestorRepresentationO", - "moduleName": "Swift" - }, - { - "kind": "Constructor", - "name": "init", - "printedName": "init(reflecting:)", - "children": [ - { - "kind": "TypeNominal", - "name": "Mirror", - "printedName": "Swift.Mirror", - "usr": "s:s6MirrorV" - }, - { - "kind": "TypeNominal", - "name": "ProtocolComposition", - "printedName": "Any" - } - ], - "declKind": "Constructor", - "usr": "s:s6MirrorV10reflectingAByp_tcfc", - "moduleName": "Swift", - "init_kind": "Designated" - }, - { - "kind": "TypeDecl", - "name": "DisplayStyle", - "printedName": "DisplayStyle", - "children": [ - { - "kind": "Var", - "name": "struct", - "printedName": "struct", - "children": [ - { - "kind": "TypeFunc", - "name": "Function", - "printedName": "(Swift.Mirror.DisplayStyle.Type) -> Swift.Mirror.DisplayStyle", - "children": [ - { - "kind": "TypeNominal", - "name": "DisplayStyle", - "printedName": "Swift.Mirror.DisplayStyle", - "usr": "s:s6MirrorV12DisplayStyleO" - }, - { - "kind": "TypeNominal", - "name": "Metatype", - "printedName": "Swift.Mirror.DisplayStyle.Type", - "children": [ - { - "kind": "TypeNominal", - "name": "DisplayStyle", - "printedName": "Swift.Mirror.DisplayStyle", - "usr": "s:s6MirrorV12DisplayStyleO" - } - ] - } - ] - } - ], - "declKind": "EnumElement", - "usr": "s:s6MirrorV12DisplayStyleO6structyA2DmF", - "moduleName": "Swift" - }, - { - "kind": "Var", - "name": "class", - "printedName": "class", - "children": [ - { - "kind": "TypeFunc", - "name": "Function", - "printedName": "(Swift.Mirror.DisplayStyle.Type) -> Swift.Mirror.DisplayStyle", - "children": [ - { - "kind": "TypeNominal", - "name": "DisplayStyle", - "printedName": "Swift.Mirror.DisplayStyle", - "usr": "s:s6MirrorV12DisplayStyleO" - }, - { - "kind": "TypeNominal", - "name": "Metatype", - "printedName": "Swift.Mirror.DisplayStyle.Type", - "children": [ - { - "kind": "TypeNominal", - "name": "DisplayStyle", - "printedName": "Swift.Mirror.DisplayStyle", - "usr": "s:s6MirrorV12DisplayStyleO" - } - ] - } - ] - } - ], - "declKind": "EnumElement", - "usr": "s:s6MirrorV12DisplayStyleO5classyA2DmF", - "moduleName": "Swift" - }, - { - "kind": "Var", - "name": "enum", - "printedName": "enum", - "children": [ - { - "kind": "TypeFunc", - "name": "Function", - "printedName": "(Swift.Mirror.DisplayStyle.Type) -> Swift.Mirror.DisplayStyle", - "children": [ - { - "kind": "TypeNominal", - "name": "DisplayStyle", - "printedName": "Swift.Mirror.DisplayStyle", - "usr": "s:s6MirrorV12DisplayStyleO" - }, - { - "kind": "TypeNominal", - "name": "Metatype", - "printedName": "Swift.Mirror.DisplayStyle.Type", - "children": [ - { - "kind": "TypeNominal", - "name": "DisplayStyle", - "printedName": "Swift.Mirror.DisplayStyle", - "usr": "s:s6MirrorV12DisplayStyleO" - } - ] - } - ] - } - ], - "declKind": "EnumElement", - "usr": "s:s6MirrorV12DisplayStyleO4enumyA2DmF", - "moduleName": "Swift" - }, - { - "kind": "Var", - "name": "tuple", - "printedName": "tuple", - "children": [ - { - "kind": "TypeFunc", - "name": "Function", - "printedName": "(Swift.Mirror.DisplayStyle.Type) -> Swift.Mirror.DisplayStyle", - "children": [ - { - "kind": "TypeNominal", - "name": "DisplayStyle", - "printedName": "Swift.Mirror.DisplayStyle", - "usr": "s:s6MirrorV12DisplayStyleO" - }, - { - "kind": "TypeNominal", - "name": "Metatype", - "printedName": "Swift.Mirror.DisplayStyle.Type", - "children": [ - { - "kind": "TypeNominal", - "name": "DisplayStyle", - "printedName": "Swift.Mirror.DisplayStyle", - "usr": "s:s6MirrorV12DisplayStyleO" - } - ] - } - ] - } - ], - "declKind": "EnumElement", - "usr": "s:s6MirrorV12DisplayStyleO5tupleyA2DmF", - "moduleName": "Swift" - }, - { - "kind": "Var", - "name": "optional", - "printedName": "optional", - "children": [ - { - "kind": "TypeFunc", - "name": "Function", - "printedName": "(Swift.Mirror.DisplayStyle.Type) -> Swift.Mirror.DisplayStyle", - "children": [ - { - "kind": "TypeNominal", - "name": "DisplayStyle", - "printedName": "Swift.Mirror.DisplayStyle", - "usr": "s:s6MirrorV12DisplayStyleO" - }, - { - "kind": "TypeNominal", - "name": "Metatype", - "printedName": "Swift.Mirror.DisplayStyle.Type", - "children": [ - { - "kind": "TypeNominal", - "name": "DisplayStyle", - "printedName": "Swift.Mirror.DisplayStyle", - "usr": "s:s6MirrorV12DisplayStyleO" - } - ] - } - ] - } - ], - "declKind": "EnumElement", - "usr": "s:s6MirrorV12DisplayStyleO8optionalyA2DmF", - "moduleName": "Swift" - }, - { - "kind": "Var", - "name": "collection", - "printedName": "collection", - "children": [ - { - "kind": "TypeFunc", - "name": "Function", - "printedName": "(Swift.Mirror.DisplayStyle.Type) -> Swift.Mirror.DisplayStyle", - "children": [ - { - "kind": "TypeNominal", - "name": "DisplayStyle", - "printedName": "Swift.Mirror.DisplayStyle", - "usr": "s:s6MirrorV12DisplayStyleO" - }, - { - "kind": "TypeNominal", - "name": "Metatype", - "printedName": "Swift.Mirror.DisplayStyle.Type", - "children": [ - { - "kind": "TypeNominal", - "name": "DisplayStyle", - "printedName": "Swift.Mirror.DisplayStyle", - "usr": "s:s6MirrorV12DisplayStyleO" - } - ] - } - ] - } - ], - "declKind": "EnumElement", - "usr": "s:s6MirrorV12DisplayStyleO10collectionyA2DmF", - "moduleName": "Swift" - }, - { - "kind": "Var", - "name": "dictionary", - "printedName": "dictionary", - "children": [ - { - "kind": "TypeFunc", - "name": "Function", - "printedName": "(Swift.Mirror.DisplayStyle.Type) -> Swift.Mirror.DisplayStyle", - "children": [ - { - "kind": "TypeNominal", - "name": "DisplayStyle", - "printedName": "Swift.Mirror.DisplayStyle", - "usr": "s:s6MirrorV12DisplayStyleO" - }, - { - "kind": "TypeNominal", - "name": "Metatype", - "printedName": "Swift.Mirror.DisplayStyle.Type", - "children": [ - { - "kind": "TypeNominal", - "name": "DisplayStyle", - "printedName": "Swift.Mirror.DisplayStyle", - "usr": "s:s6MirrorV12DisplayStyleO" - } - ] - } - ] - } - ], - "declKind": "EnumElement", - "usr": "s:s6MirrorV12DisplayStyleO10dictionaryyA2DmF", - "moduleName": "Swift" - }, - { - "kind": "Var", - "name": "set", - "printedName": "set", - "children": [ - { - "kind": "TypeFunc", - "name": "Function", - "printedName": "(Swift.Mirror.DisplayStyle.Type) -> Swift.Mirror.DisplayStyle", - "children": [ - { - "kind": "TypeNominal", - "name": "DisplayStyle", - "printedName": "Swift.Mirror.DisplayStyle", - "usr": "s:s6MirrorV12DisplayStyleO" - }, - { - "kind": "TypeNominal", - "name": "Metatype", - "printedName": "Swift.Mirror.DisplayStyle.Type", - "children": [ - { - "kind": "TypeNominal", - "name": "DisplayStyle", - "printedName": "Swift.Mirror.DisplayStyle", - "usr": "s:s6MirrorV12DisplayStyleO" + ], + "usr": "s:Sp" } - ] - } - ] - } - ], - "declKind": "EnumElement", - "usr": "s:s6MirrorV12DisplayStyleO3setyA2DmF", - "moduleName": "Swift" - }, - { - "kind": "Function", - "name": "==", - "printedName": "==(_:_:)", - "children": [ - { - "kind": "TypeNominal", - "name": "Bool", - "printedName": "Swift.Bool", - "usr": "s:Sb" - }, - { - "kind": "TypeNominal", - "name": "DisplayStyle", - "printedName": "Swift.Mirror.DisplayStyle", - "usr": "s:s6MirrorV12DisplayStyleO" - }, - { - "kind": "TypeNominal", - "name": "DisplayStyle", - "printedName": "Swift.Mirror.DisplayStyle", - "usr": "s:s6MirrorV12DisplayStyleO" - } - ], - "declKind": "Func", - "usr": "s:s6MirrorV12DisplayStyleO2eeoiySbAD_ADtFZ", - "moduleName": "Swift", - "static": true, - "implicit": true, - "funcSelfKind": "NonMutating" - }, - { - "kind": "Var", - "name": "hashValue", - "printedName": "hashValue", - "children": [ - { - "kind": "TypeNominal", - "name": "Int", - "printedName": "Swift.Int", - "usr": "s:Si" - } - ], - "declKind": "Var", - "usr": "s:s6MirrorV12DisplayStyleO9hashValueSivp", - "moduleName": "Swift", - "implicit": true, - "accessors": [ - { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", - "children": [ - { - "kind": "TypeNominal", - "name": "Int", - "printedName": "Swift.Int", - "usr": "s:Si" + ], + "usr": "s:Sq" } ], - "declKind": "Accessor", - "usr": "s:s6MirrorV12DisplayStyleO9hashValueSivg", - "moduleName": "Swift", - "implicit": true, - "accessorKind": "get" - } - ] - }, - { - "kind": "Function", - "name": "hash", - "printedName": "hash(into:)", - "children": [ - { - "kind": "TypeNominal", - "name": "Void", - "printedName": "()" - }, - { - "kind": "TypeNominal", - "name": "Hasher", - "printedName": "Swift.Hasher", - "paramValueOwnership": "InOut", - "usr": "s:s6HasherV" + "usr": "s:Sp" } ], - "declKind": "Func", - "usr": "s:s6MirrorV12DisplayStyleO4hash4intoys6HasherVz_tF", + "declKind": "Accessor", + "usr": "s:s11CommandLineO10unsafeArgvSpySpys4Int8VGSgGvgZ", "moduleName": "Swift", - "implicit": true, - "funcSelfKind": "NonMutating" - } - ], - "declKind": "Enum", - "usr": "s:s6MirrorV12DisplayStyleO", - "moduleName": "Swift", - "conformances": [ - { - "kind": "Conformance", - "name": "Equatable", - "printedName": "Equatable", - "usr": "s:SQ" - }, - { - "kind": "Conformance", - "name": "Hashable", - "printedName": "Hashable", - "usr": "s:SH" + "static": true, + "accessorKind": "get" } ] }, { - "kind": "Constructor", - "name": "init", - "printedName": "init(_:children:displayStyle:ancestorRepresentation:)", - "children": [ - { - "kind": "TypeNominal", - "name": "Mirror", - "printedName": "Swift.Mirror", - "usr": "s:s6MirrorV" - }, - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "τ_0_0" - }, - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "τ_0_1" - }, - { - "kind": "TypeNominal", - "name": "Optional", - "printedName": "Swift.Mirror.DisplayStyle?", - "children": [ - { - "kind": "TypeNominal", - "name": "DisplayStyle", - "printedName": "Swift.Mirror.DisplayStyle", - "usr": "s:s6MirrorV12DisplayStyleO" - } - ], - "hasDefaultArg": true, - "usr": "s:Sq" - }, - { - "kind": "TypeNominal", - "name": "AncestorRepresentation", - "printedName": "Swift.Mirror.AncestorRepresentation", - "hasDefaultArg": true, - "usr": "s:s6MirrorV22AncestorRepresentationO" - } - ], - "declKind": "Constructor", - "usr": "s:s6MirrorV_8children12displayStyle22ancestorRepresentationABx_q_AB07DisplayD0OSgAB08AncestorF0OtcSlR_SSSg5label_yp5valuet7ElementRt_r0_lufc", - "moduleName": "Swift", - "genericSig": "<τ_0_0, τ_0_1 where τ_0_1 : Swift.Collection, τ_0_1.Element == (label: Swift.String?, value: Any)>", - "sugared_genericSig": "", - "init_kind": "Designated" - }, - { - "kind": "Constructor", - "name": "init", - "printedName": "init(_:unlabeledChildren:displayStyle:ancestorRepresentation:)", - "children": [ - { - "kind": "TypeNominal", - "name": "Mirror", - "printedName": "Swift.Mirror", - "usr": "s:s6MirrorV" - }, - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "τ_0_0" - }, - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "τ_0_1" - }, - { - "kind": "TypeNominal", - "name": "Optional", - "printedName": "Swift.Mirror.DisplayStyle?", - "children": [ - { - "kind": "TypeNominal", - "name": "DisplayStyle", - "printedName": "Swift.Mirror.DisplayStyle", - "usr": "s:s6MirrorV12DisplayStyleO" - } - ], - "hasDefaultArg": true, - "usr": "s:Sq" - }, - { - "kind": "TypeNominal", - "name": "AncestorRepresentation", - "printedName": "Swift.Mirror.AncestorRepresentation", - "hasDefaultArg": true, - "usr": "s:s6MirrorV22AncestorRepresentationO" - } - ], - "declKind": "Constructor", - "usr": "s:s6MirrorV_17unlabeledChildren12displayStyle22ancestorRepresentationABx_q_AB07DisplayE0OSgAB08AncestorG0OtcSlR_r0_lufc", - "moduleName": "Swift", - "genericSig": "<τ_0_0, τ_0_1 where τ_0_1 : Swift.Collection>", - "sugared_genericSig": "", - "init_kind": "Designated" - }, - { - "kind": "Constructor", - "name": "init", - "printedName": "init(_:children:displayStyle:ancestorRepresentation:)", + "kind": "Var", + "name": "arguments", + "printedName": "arguments", "children": [ { "kind": "TypeNominal", - "name": "Mirror", - "printedName": "Swift.Mirror", - "usr": "s:s6MirrorV" - }, - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "τ_0_0" - }, - { - "kind": "TypeNominal", - "name": "KeyValuePairs", - "printedName": "Swift.KeyValuePairs", + "name": "Array", + "printedName": "[Swift.String]", "children": [ { "kind": "TypeNominal", "name": "String", "printedName": "Swift.String", "usr": "s:SS" - }, - { - "kind": "TypeNominal", - "name": "ProtocolComposition", - "printedName": "Any" - } - ], - "usr": "s:s13KeyValuePairsV" - }, - { - "kind": "TypeNominal", - "name": "Optional", - "printedName": "Swift.Mirror.DisplayStyle?", - "children": [ - { - "kind": "TypeNominal", - "name": "DisplayStyle", - "printedName": "Swift.Mirror.DisplayStyle", - "usr": "s:s6MirrorV12DisplayStyleO" } ], - "hasDefaultArg": true, - "usr": "s:Sq" - }, - { - "kind": "TypeNominal", - "name": "AncestorRepresentation", - "printedName": "Swift.Mirror.AncestorRepresentation", - "hasDefaultArg": true, - "usr": "s:s6MirrorV22AncestorRepresentationO" - } - ], - "declKind": "Constructor", - "usr": "s:s6MirrorV_8children12displayStyle22ancestorRepresentationABx_s13KeyValuePairsVySSypGAB07DisplayD0OSgAB08AncestorF0Otclufc", - "moduleName": "Swift", - "genericSig": "<τ_0_0>", - "sugared_genericSig": "", - "init_kind": "Designated" - }, - { - "kind": "Var", - "name": "subjectType", - "printedName": "subjectType", - "children": [ - { - "kind": "TypeNominal", - "name": "ExistentialMetatype", - "printedName": "any Any.Type", - "children": [ - { - "kind": "TypeNominal", - "name": "ProtocolComposition", - "printedName": "Any" - } - ] + "usr": "s:Sa" } ], "declKind": "Var", - "usr": "s:s6MirrorV11subjectTypeypXpvp", + "usr": "s:s11CommandLineO9argumentsSaySSGvpZ", "moduleName": "Swift", + "static": true, "declAttributes": [ + "HasInitialValue", "HasStorage" ], - "isLet": true, "hasStorage": true, "accessors": [ { @@ -205264,964 +204177,75 @@ "children": [ { "kind": "TypeNominal", - "name": "ExistentialMetatype", - "printedName": "any Any.Type", + "name": "Array", + "printedName": "[Swift.String]", "children": [ { "kind": "TypeNominal", - "name": "ProtocolComposition", - "printedName": "Any" + "name": "String", + "printedName": "Swift.String", + "usr": "s:SS" } - ] + ], + "usr": "s:Sa" } ], "declKind": "Accessor", - "usr": "s:s6MirrorV11subjectTypeypXpvg", + "usr": "s:s11CommandLineO9argumentsSaySSGvgZ", "moduleName": "Swift", + "static": true, "implicit": true, "accessorKind": "get" - } - ] - }, - { - "kind": "Var", - "name": "children", - "printedName": "children", - "children": [ + }, { - "kind": "TypeNominal", - "name": "AnyCollection", - "printedName": "Swift.AnyCollection<(label: Swift.String?, value: Any)>", + "kind": "Accessor", + "name": "Set", + "printedName": "Set()", "children": [ { "kind": "TypeNominal", - "name": "Tuple", - "printedName": "(label: Swift.String?, value: Any)", - "children": [ - { - "kind": "TypeNominal", - "name": "Optional", - "printedName": "Swift.String?", - "children": [ - { - "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" - } - ], - "usr": "s:Sq" - }, - { - "kind": "TypeNominal", - "name": "ProtocolComposition", - "printedName": "Any" - } - ] - } - ], - "usr": "s:s13AnyCollectionV" - } - ], - "declKind": "Var", - "usr": "s:s6MirrorV8childrens13AnyCollectionVySSSg5label_yp5valuetGvp", - "moduleName": "Swift", - "declAttributes": [ - "HasStorage" - ], - "isLet": true, - "hasStorage": true, - "accessors": [ - { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", - "children": [ + "name": "Void", + "printedName": "()" + }, { "kind": "TypeNominal", - "name": "AnyCollection", - "printedName": "Swift.AnyCollection<(label: Swift.String?, value: Any)>", + "name": "Array", + "printedName": "[Swift.String]", "children": [ { "kind": "TypeNominal", - "name": "Tuple", - "printedName": "(label: Swift.String?, value: Any)", - "children": [ - { - "kind": "TypeNominal", - "name": "Optional", - "printedName": "Swift.String?", - "children": [ - { - "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" - } - ], - "usr": "s:Sq" - }, - { - "kind": "TypeNominal", - "name": "ProtocolComposition", - "printedName": "Any" - } - ] + "name": "String", + "printedName": "Swift.String", + "usr": "s:SS" } ], - "usr": "s:s13AnyCollectionV" + "usr": "s:Sa" } ], "declKind": "Accessor", - "usr": "s:s6MirrorV8childrens13AnyCollectionVySSSg5label_yp5valuetGvg", + "usr": "s:s11CommandLineO9argumentsSaySSGvsZ", "moduleName": "Swift", + "static": true, "implicit": true, - "accessorKind": "get" - } - ] - }, - { - "kind": "Var", - "name": "displayStyle", - "printedName": "displayStyle", - "children": [ + "accessorKind": "set" + }, { - "kind": "TypeNominal", - "name": "Optional", - "printedName": "Swift.Mirror.DisplayStyle?", + "kind": "Accessor", + "name": "Modify", + "printedName": "Modify()", "children": [ { "kind": "TypeNominal", - "name": "DisplayStyle", - "printedName": "Swift.Mirror.DisplayStyle", - "usr": "s:s6MirrorV12DisplayStyleO" + "name": "Void", + "printedName": "()" } ], - "usr": "s:Sq" - } - ], - "declKind": "Var", - "usr": "s:s6MirrorV12displayStyleAB07DisplayC0OSgvp", - "moduleName": "Swift", - "declAttributes": [ - "HasStorage" - ], - "isLet": true, - "hasStorage": true, - "accessors": [ - { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", - "children": [ - { - "kind": "TypeNominal", - "name": "Optional", - "printedName": "Swift.Mirror.DisplayStyle?", - "children": [ - { - "kind": "TypeNominal", - "name": "DisplayStyle", - "printedName": "Swift.Mirror.DisplayStyle", - "usr": "s:s6MirrorV12DisplayStyleO" - } - ], - "usr": "s:Sq" - } - ], - "declKind": "Accessor", - "usr": "s:s6MirrorV12displayStyleAB07DisplayC0OSgvg", - "moduleName": "Swift", - "implicit": true, - "accessorKind": "get" - } - ] - }, - { - "kind": "Var", - "name": "superclassMirror", - "printedName": "superclassMirror", - "children": [ - { - "kind": "TypeNominal", - "name": "Optional", - "printedName": "Swift.Mirror?", - "children": [ - { - "kind": "TypeNominal", - "name": "Mirror", - "printedName": "Swift.Mirror", - "usr": "s:s6MirrorV" - } - ], - "usr": "s:Sq" - } - ], - "declKind": "Var", - "usr": "s:s6MirrorV010superclassA0ABSgvp", - "moduleName": "Swift", - "accessors": [ - { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", - "children": [ - { - "kind": "TypeNominal", - "name": "Optional", - "printedName": "Swift.Mirror?", - "children": [ - { - "kind": "TypeNominal", - "name": "Mirror", - "printedName": "Swift.Mirror", - "usr": "s:s6MirrorV" - } - ], - "usr": "s:Sq" - } - ], - "declKind": "Accessor", - "usr": "s:s6MirrorV010superclassA0ABSgvg", - "moduleName": "Swift", - "accessorKind": "get" - } - ] - }, - { - "kind": "Function", - "name": "descendant", - "printedName": "descendant(_:_:)", - "children": [ - { - "kind": "TypeNominal", - "name": "Optional", - "printedName": "Any?", - "children": [ - { - "kind": "TypeNominal", - "name": "ProtocolComposition", - "printedName": "Any" - } - ], - "usr": "s:Sq" - }, - { - "kind": "TypeNominal", - "name": "MirrorPath", - "printedName": "any Swift.MirrorPath", - "usr": "s:s10MirrorPathP" - }, - { - "kind": "TypeNominal", - "name": "Array", - "printedName": "[any Swift.MirrorPath]", - "children": [ - { - "kind": "TypeNominal", - "name": "MirrorPath", - "printedName": "any Swift.MirrorPath", - "usr": "s:s10MirrorPathP" - } - ], - "usr": "s:Sa" - } - ], - "declKind": "Func", - "usr": "s:s6MirrorV10descendantyypSgs0A4Path_p_sAE_pdtF", - "moduleName": "Swift", - "funcSelfKind": "NonMutating" - }, - { - "kind": "Var", - "name": "description", - "printedName": "description", - "children": [ - { - "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" - } - ], - "declKind": "Var", - "usr": "s:s6MirrorV11descriptionSSvp", - "moduleName": "Swift", - "accessors": [ - { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", - "children": [ - { - "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" - } - ], - "declKind": "Accessor", - "usr": "s:s6MirrorV11descriptionSSvg", - "moduleName": "Swift", - "accessorKind": "get" - } - ] - }, - { - "kind": "Var", - "name": "customMirror", - "printedName": "customMirror", - "children": [ - { - "kind": "TypeNominal", - "name": "Mirror", - "printedName": "Swift.Mirror", - "usr": "s:s6MirrorV" - } - ], - "declKind": "Var", - "usr": "s:s6MirrorV06customA0ABvp", - "moduleName": "Swift", - "accessors": [ - { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", - "children": [ - { - "kind": "TypeNominal", - "name": "Mirror", - "printedName": "Swift.Mirror", - "usr": "s:s6MirrorV" - } - ], - "declKind": "Accessor", - "usr": "s:s6MirrorV06customA0ABvg", - "moduleName": "Swift", - "accessorKind": "get" - } - ] - } - ], - "declKind": "Struct", - "usr": "s:s6MirrorV", - "moduleName": "Swift", - "conformances": [ - { - "kind": "Conformance", - "name": "CustomStringConvertible", - "printedName": "CustomStringConvertible", - "usr": "s:s23CustomStringConvertibleP" - }, - { - "kind": "Conformance", - "name": "CustomReflectable", - "printedName": "CustomReflectable", - "usr": "s:s17CustomReflectableP" - } - ] - }, - { - "kind": "TypeDecl", - "name": "CustomReflectable", - "printedName": "CustomReflectable", - "children": [ - { - "kind": "Var", - "name": "customMirror", - "printedName": "customMirror", - "children": [ - { - "kind": "TypeNominal", - "name": "Mirror", - "printedName": "Swift.Mirror", - "usr": "s:s6MirrorV" - } - ], - "declKind": "Var", - "usr": "s:s17CustomReflectableP12customMirrors0D0Vvp", - "moduleName": "Swift", - "protocolReq": true, - "accessors": [ - { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", - "children": [ - { - "kind": "TypeNominal", - "name": "Mirror", - "printedName": "Swift.Mirror", - "usr": "s:s6MirrorV" - } - ], - "declKind": "Accessor", - "usr": "s:s17CustomReflectableP12customMirrors0D0Vvg", - "moduleName": "Swift", - "genericSig": "<τ_0_0 where τ_0_0 : Swift.CustomReflectable>", - "sugared_genericSig": "", - "protocolReq": true, - "reqNewWitnessTableEntry": true, - "accessorKind": "get" - } - ] - } - ], - "declKind": "Protocol", - "usr": "s:s17CustomReflectableP", - "moduleName": "Swift" - }, - { - "kind": "TypeDecl", - "name": "CustomLeafReflectable", - "printedName": "CustomLeafReflectable", - "declKind": "Protocol", - "usr": "s:s21CustomLeafReflectableP", - "moduleName": "Swift", - "genericSig": "<τ_0_0 : Swift.CustomReflectable>", - "sugared_genericSig": "", - "conformances": [ - { - "kind": "Conformance", - "name": "CustomReflectable", - "printedName": "CustomReflectable", - "usr": "s:s17CustomReflectableP" - } - ] - }, - { - "kind": "TypeDecl", - "name": "MirrorPath", - "printedName": "MirrorPath", - "declKind": "Protocol", - "usr": "s:s10MirrorPathP", - "moduleName": "Swift" - }, - { - "kind": "TypeDecl", - "name": "CustomPlaygroundDisplayConvertible", - "printedName": "CustomPlaygroundDisplayConvertible", - "children": [ - { - "kind": "Var", - "name": "playgroundDescription", - "printedName": "playgroundDescription", - "children": [ - { - "kind": "TypeNominal", - "name": "ProtocolComposition", - "printedName": "Any" - } - ], - "declKind": "Var", - "usr": "s:s34CustomPlaygroundDisplayConvertibleP21playgroundDescriptionypvp", - "moduleName": "Swift", - "protocolReq": true, - "accessors": [ - { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", - "children": [ - { - "kind": "TypeNominal", - "name": "ProtocolComposition", - "printedName": "Any" - } - ], - "declKind": "Accessor", - "usr": "s:s34CustomPlaygroundDisplayConvertibleP21playgroundDescriptionypvg", - "moduleName": "Swift", - "genericSig": "<τ_0_0 where τ_0_0 : Swift.CustomPlaygroundDisplayConvertible>", - "sugared_genericSig": "", - "protocolReq": true, - "reqNewWitnessTableEntry": true, - "accessorKind": "get" - } - ] - } - ], - "declKind": "Protocol", - "usr": "s:s34CustomPlaygroundDisplayConvertibleP", - "moduleName": "Swift" - }, - { - "kind": "TypeDecl", - "name": "CommandLine", - "printedName": "CommandLine", - "children": [ - { - "kind": "Var", - "name": "_argc", - "printedName": "_argc", - "children": [ - { - "kind": "TypeNominal", - "name": "Int32", - "printedName": "Swift.Int32", - "usr": "s:s5Int32V" - } - ], - "declKind": "Var", - "usr": "s:s11CommandLineO5_argcs5Int32VvpZ", - "moduleName": "Swift", - "static": true, - "declAttributes": [ - "HasInitialValue", - "UsableFromInline", - "HasStorage" - ], - "hasStorage": true, - "accessors": [ - { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", - "children": [ - { - "kind": "TypeNominal", - "name": "Int32", - "printedName": "Swift.Int32", - "usr": "s:s5Int32V" - } - ], - "declKind": "Accessor", - "usr": "s:s11CommandLineO5_argcs5Int32VvgZ", - "moduleName": "Swift", - "static": true, - "implicit": true, - "accessorKind": "get" - }, - { - "kind": "Accessor", - "name": "Set", - "printedName": "Set()", - "children": [ - { - "kind": "TypeNominal", - "name": "Void", - "printedName": "()" - }, - { - "kind": "TypeNominal", - "name": "Int32", - "printedName": "Swift.Int32", - "usr": "s:s5Int32V" - } - ], - "declKind": "Accessor", - "usr": "s:s11CommandLineO5_argcs5Int32VvsZ", - "moduleName": "Swift", - "static": true, - "implicit": true, - "accessorKind": "set" - }, - { - "kind": "Accessor", - "name": "Modify", - "printedName": "Modify()", - "children": [ - { - "kind": "TypeNominal", - "name": "Void", - "printedName": "()" - } - ], - "declKind": "Accessor", - "usr": "s:s11CommandLineO5_argcs5Int32VvMZ", - "moduleName": "Swift", - "static": true, - "implicit": true, - "accessorKind": "_modify" - } - ] - }, - { - "kind": "Var", - "name": "_unsafeArgv", - "printedName": "_unsafeArgv", - "children": [ - { - "kind": "TypeNominal", - "name": "UnsafeMutablePointer", - "printedName": "Swift.UnsafeMutablePointer?>", - "children": [ - { - "kind": "TypeNominal", - "name": "Optional", - "printedName": "Swift.UnsafeMutablePointer?", - "children": [ - { - "kind": "TypeNominal", - "name": "UnsafeMutablePointer", - "printedName": "Swift.UnsafeMutablePointer", - "children": [ - { - "kind": "TypeNominal", - "name": "Int8", - "printedName": "Swift.Int8", - "usr": "s:s4Int8V" - } - ], - "usr": "s:Sp" - } - ], - "usr": "s:Sq" - } - ], - "usr": "s:Sp" - } - ], - "declKind": "Var", - "usr": "s:s11CommandLineO11_unsafeArgvSpySpys4Int8VGSgGvpZ", - "moduleName": "Swift", - "static": true, - "declAttributes": [ - "HasInitialValue", - "UsableFromInline", - "HasStorage" - ], - "hasStorage": true, - "accessors": [ - { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", - "children": [ - { - "kind": "TypeNominal", - "name": "UnsafeMutablePointer", - "printedName": "Swift.UnsafeMutablePointer?>", - "children": [ - { - "kind": "TypeNominal", - "name": "Optional", - "printedName": "Swift.UnsafeMutablePointer?", - "children": [ - { - "kind": "TypeNominal", - "name": "UnsafeMutablePointer", - "printedName": "Swift.UnsafeMutablePointer", - "children": [ - { - "kind": "TypeNominal", - "name": "Int8", - "printedName": "Swift.Int8", - "usr": "s:s4Int8V" - } - ], - "usr": "s:Sp" - } - ], - "usr": "s:Sq" - } - ], - "usr": "s:Sp" - } - ], - "declKind": "Accessor", - "usr": "s:s11CommandLineO11_unsafeArgvSpySpys4Int8VGSgGvgZ", - "moduleName": "Swift", - "static": true, - "implicit": true, - "accessorKind": "get" - }, - { - "kind": "Accessor", - "name": "Set", - "printedName": "Set()", - "children": [ - { - "kind": "TypeNominal", - "name": "Void", - "printedName": "()" - }, - { - "kind": "TypeNominal", - "name": "UnsafeMutablePointer", - "printedName": "Swift.UnsafeMutablePointer?>", - "children": [ - { - "kind": "TypeNominal", - "name": "Optional", - "printedName": "Swift.UnsafeMutablePointer?", - "children": [ - { - "kind": "TypeNominal", - "name": "UnsafeMutablePointer", - "printedName": "Swift.UnsafeMutablePointer", - "children": [ - { - "kind": "TypeNominal", - "name": "Int8", - "printedName": "Swift.Int8", - "usr": "s:s4Int8V" - } - ], - "usr": "s:Sp" - } - ], - "usr": "s:Sq" - } - ], - "usr": "s:Sp" - } - ], - "declKind": "Accessor", - "usr": "s:s11CommandLineO11_unsafeArgvSpySpys4Int8VGSgGvsZ", - "moduleName": "Swift", - "static": true, - "implicit": true, - "accessorKind": "set" - }, - { - "kind": "Accessor", - "name": "Modify", - "printedName": "Modify()", - "children": [ - { - "kind": "TypeNominal", - "name": "Void", - "printedName": "()" - } - ], - "declKind": "Accessor", - "usr": "s:s11CommandLineO11_unsafeArgvSpySpys4Int8VGSgGvMZ", - "moduleName": "Swift", - "static": true, - "implicit": true, - "accessorKind": "_modify" - } - ] - }, - { - "kind": "Var", - "name": "argc", - "printedName": "argc", - "children": [ - { - "kind": "TypeNominal", - "name": "Int32", - "printedName": "Swift.Int32", - "usr": "s:s5Int32V" - } - ], - "declKind": "Var", - "usr": "s:s11CommandLineO4argcs5Int32VvpZ", - "moduleName": "Swift", - "static": true, - "accessors": [ - { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", - "children": [ - { - "kind": "TypeNominal", - "name": "Int32", - "printedName": "Swift.Int32", - "usr": "s:s5Int32V" - } - ], - "declKind": "Accessor", - "usr": "s:s11CommandLineO4argcs5Int32VvgZ", - "moduleName": "Swift", - "static": true, - "accessorKind": "get" - } - ] - }, - { - "kind": "Var", - "name": "unsafeArgv", - "printedName": "unsafeArgv", - "children": [ - { - "kind": "TypeNominal", - "name": "UnsafeMutablePointer", - "printedName": "Swift.UnsafeMutablePointer?>", - "children": [ - { - "kind": "TypeNominal", - "name": "Optional", - "printedName": "Swift.UnsafeMutablePointer?", - "children": [ - { - "kind": "TypeNominal", - "name": "UnsafeMutablePointer", - "printedName": "Swift.UnsafeMutablePointer", - "children": [ - { - "kind": "TypeNominal", - "name": "Int8", - "printedName": "Swift.Int8", - "usr": "s:s4Int8V" - } - ], - "usr": "s:Sp" - } - ], - "usr": "s:Sq" - } - ], - "usr": "s:Sp" - } - ], - "declKind": "Var", - "usr": "s:s11CommandLineO10unsafeArgvSpySpys4Int8VGSgGvpZ", - "moduleName": "Swift", - "static": true, - "accessors": [ - { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", - "children": [ - { - "kind": "TypeNominal", - "name": "UnsafeMutablePointer", - "printedName": "Swift.UnsafeMutablePointer?>", - "children": [ - { - "kind": "TypeNominal", - "name": "Optional", - "printedName": "Swift.UnsafeMutablePointer?", - "children": [ - { - "kind": "TypeNominal", - "name": "UnsafeMutablePointer", - "printedName": "Swift.UnsafeMutablePointer", - "children": [ - { - "kind": "TypeNominal", - "name": "Int8", - "printedName": "Swift.Int8", - "usr": "s:s4Int8V" - } - ], - "usr": "s:Sp" - } - ], - "usr": "s:Sq" - } - ], - "usr": "s:Sp" - } - ], - "declKind": "Accessor", - "usr": "s:s11CommandLineO10unsafeArgvSpySpys4Int8VGSgGvgZ", - "moduleName": "Swift", - "static": true, - "accessorKind": "get" - } - ] - }, - { - "kind": "Var", - "name": "arguments", - "printedName": "arguments", - "children": [ - { - "kind": "TypeNominal", - "name": "Array", - "printedName": "[Swift.String]", - "children": [ - { - "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" - } - ], - "usr": "s:Sa" - } - ], - "declKind": "Var", - "usr": "s:s11CommandLineO9argumentsSaySSGvpZ", - "moduleName": "Swift", - "static": true, - "declAttributes": [ - "HasInitialValue", - "HasStorage" - ], - "hasStorage": true, - "accessors": [ - { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", - "children": [ - { - "kind": "TypeNominal", - "name": "Array", - "printedName": "[Swift.String]", - "children": [ - { - "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" - } - ], - "usr": "s:Sa" - } - ], - "declKind": "Accessor", - "usr": "s:s11CommandLineO9argumentsSaySSGvgZ", - "moduleName": "Swift", - "static": true, - "implicit": true, - "accessorKind": "get" - }, - { - "kind": "Accessor", - "name": "Set", - "printedName": "Set()", - "children": [ - { - "kind": "TypeNominal", - "name": "Void", - "printedName": "()" - }, - { - "kind": "TypeNominal", - "name": "Array", - "printedName": "[Swift.String]", - "children": [ - { - "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" - } - ], - "usr": "s:Sa" - } - ], - "declKind": "Accessor", - "usr": "s:s11CommandLineO9argumentsSaySSGvsZ", - "moduleName": "Swift", - "static": true, - "implicit": true, - "accessorKind": "set" - }, - { - "kind": "Accessor", - "name": "Modify", - "printedName": "Modify()", - "children": [ - { - "kind": "TypeNominal", - "name": "Void", - "printedName": "()" - } - ], - "declKind": "Accessor", - "usr": "s:s11CommandLineO9argumentsSaySSGvMZ", - "moduleName": "Swift", - "static": true, - "implicit": true, - "accessorKind": "_modify" + "declKind": "Accessor", + "usr": "s:s11CommandLineO9argumentsSaySSGvMZ", + "moduleName": "Swift", + "static": true, + "implicit": true, + "accessorKind": "_modify" } ] } @@ -206233,1636 +204257,6 @@ "Frozen" ] }, - { - "kind": "TypeDecl", - "name": "RangeSet", - "printedName": "RangeSet", - "children": [ - { - "kind": "Constructor", - "name": "init", - "printedName": "init()", - "children": [ - { - "kind": "TypeNominal", - "name": "RangeSet", - "printedName": "Swift.RangeSet<τ_0_0>", - "children": [ - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "τ_0_0" - } - ], - "usr": "s:s8RangeSetV" - } - ], - "declKind": "Constructor", - "usr": "s:s8RangeSetVAByxGycfc", - "moduleName": "Swift", - "genericSig": "<τ_0_0 where τ_0_0 : Swift.Comparable>", - "sugared_genericSig": "", - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", - "init_kind": "Designated" - }, - { - "kind": "Constructor", - "name": "init", - "printedName": "init(_:)", - "children": [ - { - "kind": "TypeNominal", - "name": "RangeSet", - "printedName": "Swift.RangeSet<τ_0_0>", - "children": [ - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "τ_0_0" - } - ], - "usr": "s:s8RangeSetV" - }, - { - "kind": "TypeNominal", - "name": "Range", - "printedName": "Swift.Range<τ_0_0>", - "children": [ - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "τ_0_0" - } - ], - "usr": "s:Sn" - } - ], - "declKind": "Constructor", - "usr": "s:s8RangeSetVyAByxGSnyxGcfc", - "moduleName": "Swift", - "genericSig": "<τ_0_0 where τ_0_0 : Swift.Comparable>", - "sugared_genericSig": "", - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", - "init_kind": "Designated" - }, - { - "kind": "Constructor", - "name": "init", - "printedName": "init(_:)", - "children": [ - { - "kind": "TypeNominal", - "name": "RangeSet", - "printedName": "Swift.RangeSet<τ_0_0>", - "children": [ - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "τ_0_0" - } - ], - "usr": "s:s8RangeSetV" - }, - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "τ_1_0" - } - ], - "declKind": "Constructor", - "usr": "s:s8RangeSetVyAByxGqd__cSTRd__SnyxG7ElementRtd__lufc", - "moduleName": "Swift", - "genericSig": "<τ_0_0, τ_1_0 where τ_0_0 : Swift.Comparable, τ_1_0 : Swift.Sequence, τ_1_0.Element == Swift.Range<τ_0_0>>", - "sugared_genericSig": ">", - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", - "init_kind": "Designated" - }, - { - "kind": "Var", - "name": "isEmpty", - "printedName": "isEmpty", - "children": [ - { - "kind": "TypeNominal", - "name": "Bool", - "printedName": "Swift.Bool", - "usr": "s:Sb" - } - ], - "declKind": "Var", - "usr": "s:s8RangeSetV7isEmptySbvp", - "moduleName": "Swift", - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", - "accessors": [ - { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", - "children": [ - { - "kind": "TypeNominal", - "name": "Bool", - "printedName": "Swift.Bool", - "usr": "s:Sb" - } - ], - "declKind": "Accessor", - "usr": "s:s8RangeSetV7isEmptySbvg", - "moduleName": "Swift", - "genericSig": "<τ_0_0 where τ_0_0 : Swift.Comparable>", - "sugared_genericSig": "", - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", - "accessorKind": "get" - } - ] - }, - { - "kind": "Function", - "name": "contains", - "printedName": "contains(_:)", - "children": [ - { - "kind": "TypeNominal", - "name": "Bool", - "printedName": "Swift.Bool", - "usr": "s:Sb" - }, - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "τ_0_0" - } - ], - "declKind": "Func", - "usr": "s:s8RangeSetV8containsySbxF", - "moduleName": "Swift", - "genericSig": "<τ_0_0 where τ_0_0 : Swift.Comparable>", - "sugared_genericSig": "", - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", - "funcSelfKind": "NonMutating" - }, - { - "kind": "Function", - "name": "insert", - "printedName": "insert(contentsOf:)", - "children": [ - { - "kind": "TypeNominal", - "name": "Void", - "printedName": "()" - }, - { - "kind": "TypeNominal", - "name": "Range", - "printedName": "Swift.Range<τ_0_0>", - "children": [ - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "τ_0_0" - } - ], - "usr": "s:Sn" - } - ], - "declKind": "Func", - "usr": "s:s8RangeSetV6insert10contentsOfySnyxG_tF", - "moduleName": "Swift", - "genericSig": "<τ_0_0 where τ_0_0 : Swift.Comparable>", - "sugared_genericSig": "", - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", - "funcSelfKind": "Mutating" - }, - { - "kind": "Function", - "name": "remove", - "printedName": "remove(contentsOf:)", - "children": [ - { - "kind": "TypeNominal", - "name": "Void", - "printedName": "()" - }, - { - "kind": "TypeNominal", - "name": "Range", - "printedName": "Swift.Range<τ_0_0>", - "children": [ - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "τ_0_0" - } - ], - "usr": "s:Sn" - } - ], - "declKind": "Func", - "usr": "s:s8RangeSetV6remove10contentsOfySnyxG_tF", - "moduleName": "Swift", - "genericSig": "<τ_0_0 where τ_0_0 : Swift.Comparable>", - "sugared_genericSig": "", - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", - "funcSelfKind": "Mutating" - }, - { - "kind": "Function", - "name": "==", - "printedName": "==(_:_:)", - "children": [ - { - "kind": "TypeNominal", - "name": "Bool", - "printedName": "Swift.Bool", - "usr": "s:Sb" - }, - { - "kind": "TypeNominal", - "name": "RangeSet", - "printedName": "Swift.RangeSet<τ_0_0>", - "children": [ - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "τ_0_0" - } - ], - "usr": "s:s8RangeSetV" - }, - { - "kind": "TypeNominal", - "name": "RangeSet", - "printedName": "Swift.RangeSet<τ_0_0>", - "children": [ - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "τ_0_0" - } - ], - "usr": "s:s8RangeSetV" - } - ], - "declKind": "Func", - "usr": "s:s8RangeSetV2eeoiySbAByxG_ADtFZ", - "moduleName": "Swift", - "genericSig": "<τ_0_0 where τ_0_0 : Swift.Comparable>", - "sugared_genericSig": "", - "static": true, - "implicit": true, - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", - "funcSelfKind": "NonMutating" - }, - { - "kind": "Var", - "name": "hashValue", - "printedName": "hashValue", - "children": [ - { - "kind": "TypeNominal", - "name": "Int", - "printedName": "Swift.Int", - "usr": "s:Si" - } - ], - "declKind": "Var", - "usr": "s:s8RangeSetVsSHRzrlE9hashValueSivp", - "moduleName": "Swift", - "implicit": true, - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", - "accessors": [ - { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", - "children": [ - { - "kind": "TypeNominal", - "name": "Int", - "printedName": "Swift.Int", - "usr": "s:Si" - } - ], - "declKind": "Accessor", - "usr": "s:s8RangeSetVsSHRzrlE9hashValueSivg", - "moduleName": "Swift", - "genericSig": "<τ_0_0 where τ_0_0 : Swift.Comparable, τ_0_0 : Swift.Hashable>", - "sugared_genericSig": "", - "implicit": true, - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", - "accessorKind": "get" - } - ] - }, - { - "kind": "Function", - "name": "hash", - "printedName": "hash(into:)", - "children": [ - { - "kind": "TypeNominal", - "name": "Void", - "printedName": "()" - }, - { - "kind": "TypeNominal", - "name": "Hasher", - "printedName": "Swift.Hasher", - "paramValueOwnership": "InOut", - "usr": "s:s6HasherV" - } - ], - "declKind": "Func", - "usr": "s:s8RangeSetVsSHRzrlE4hash4intoys6HasherVz_tF", - "moduleName": "Swift", - "genericSig": "<τ_0_0 where τ_0_0 : Swift.Comparable, τ_0_0 : Swift.Hashable>", - "sugared_genericSig": "", - "implicit": true, - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", - "funcSelfKind": "NonMutating" - }, - { - "kind": "TypeDecl", - "name": "Ranges", - "printedName": "Ranges", - "children": [ - { - "kind": "Var", - "name": "startIndex", - "printedName": "startIndex", - "children": [ - { - "kind": "TypeNominal", - "name": "Int", - "printedName": "Swift.Int", - "usr": "s:Si" - } - ], - "declKind": "Var", - "usr": "s:s8RangeSetV6RangesV10startIndexSivp", - "moduleName": "Swift", - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", - "accessors": [ - { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", - "children": [ - { - "kind": "TypeNominal", - "name": "Int", - "printedName": "Swift.Int", - "usr": "s:Si" - } - ], - "declKind": "Accessor", - "usr": "s:s8RangeSetV6RangesV10startIndexSivg", - "moduleName": "Swift", - "genericSig": "<τ_0_0 where τ_0_0 : Swift.Comparable>", - "sugared_genericSig": "", - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", - "accessorKind": "get" - } - ] - }, - { - "kind": "Var", - "name": "endIndex", - "printedName": "endIndex", - "children": [ - { - "kind": "TypeNominal", - "name": "Int", - "printedName": "Swift.Int", - "usr": "s:Si" - } - ], - "declKind": "Var", - "usr": "s:s8RangeSetV6RangesV8endIndexSivp", - "moduleName": "Swift", - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", - "accessors": [ - { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", - "children": [ - { - "kind": "TypeNominal", - "name": "Int", - "printedName": "Swift.Int", - "usr": "s:Si" - } - ], - "declKind": "Accessor", - "usr": "s:s8RangeSetV6RangesV8endIndexSivg", - "moduleName": "Swift", - "genericSig": "<τ_0_0 where τ_0_0 : Swift.Comparable>", - "sugared_genericSig": "", - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", - "accessorKind": "get" - } - ] - }, - { - "kind": "Subscript", - "name": "subscript", - "printedName": "subscript(_:)", - "children": [ - { - "kind": "TypeNominal", - "name": "Range", - "printedName": "Swift.Range<τ_0_0>", - "children": [ - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "τ_0_0" - } - ], - "usr": "s:Sn" - }, - { - "kind": "TypeNominal", - "name": "Int", - "printedName": "Swift.Int", - "usr": "s:Si" - } - ], - "declKind": "Subscript", - "usr": "s:s8RangeSetV6RangesVySnyxGSicip", - "moduleName": "Swift", - "genericSig": "<τ_0_0 where τ_0_0 : Swift.Comparable>", - "sugared_genericSig": "", - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", - "accessors": [ - { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", - "children": [ - { - "kind": "TypeNominal", - "name": "Range", - "printedName": "Swift.Range<τ_0_0>", - "children": [ - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "τ_0_0" - } - ], - "usr": "s:Sn" - }, - { - "kind": "TypeNominal", - "name": "Int", - "printedName": "Swift.Int", - "usr": "s:Si" - } - ], - "declKind": "Accessor", - "usr": "s:s8RangeSetV6RangesVySnyxGSicig", - "moduleName": "Swift", - "genericSig": "<τ_0_0 where τ_0_0 : Swift.Comparable>", - "sugared_genericSig": "", - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", - "accessorKind": "get" - } - ] - } - ], - "declKind": "Struct", - "usr": "s:s8RangeSetV6RangesV", - "moduleName": "Swift", - "genericSig": "<τ_0_0 where τ_0_0 : Swift.Comparable>", - "sugared_genericSig": "", - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", - "conformances": [ - { - "kind": "Conformance", - "name": "RandomAccessCollection", - "printedName": "RandomAccessCollection", - "children": [ - { - "kind": "TypeWitness", - "name": "Element", - "printedName": "Element", - "children": [ - { - "kind": "TypeNominal", - "name": "Range", - "printedName": "Swift.Range<τ_0_0>", - "children": [ - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "τ_0_0" - } - ], - "usr": "s:Sn" - } - ] - }, - { - "kind": "TypeWitness", - "name": "Index", - "printedName": "Index", - "children": [ - { - "kind": "TypeNominal", - "name": "Int", - "printedName": "Swift.Int", - "usr": "s:Si" - } - ] - }, - { - "kind": "TypeWitness", - "name": "SubSequence", - "printedName": "SubSequence", - "children": [ - { - "kind": "TypeNominal", - "name": "Slice", - "printedName": "Swift.Slice.Ranges>", - "children": [ - { - "kind": "TypeNominal", - "name": "Ranges", - "printedName": "Swift.RangeSet<τ_0_0>.Ranges", - "usr": "s:s8RangeSetV6RangesV" - } - ], - "usr": "s:s5SliceV" - } - ] - }, - { - "kind": "TypeWitness", - "name": "Indices", - "printedName": "Indices", - "children": [ - { - "kind": "TypeNominal", - "name": "Range", - "printedName": "Swift.Range", - "children": [ - { - "kind": "TypeNominal", - "name": "Int", - "printedName": "Swift.Int", - "usr": "s:Si" - } - ], - "usr": "s:Sn" - } - ] - } - ], - "usr": "s:Sk", - "isABIPlaceholder": true - }, - { - "kind": "Conformance", - "name": "BidirectionalCollection", - "printedName": "BidirectionalCollection", - "children": [ - { - "kind": "TypeWitness", - "name": "Element", - "printedName": "Element", - "children": [ - { - "kind": "TypeNominal", - "name": "Range", - "printedName": "Swift.Range<τ_0_0>", - "children": [ - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "τ_0_0" - } - ], - "usr": "s:Sn" - } - ] - }, - { - "kind": "TypeWitness", - "name": "Index", - "printedName": "Index", - "children": [ - { - "kind": "TypeNominal", - "name": "Int", - "printedName": "Swift.Int", - "usr": "s:Si" - } - ] - }, - { - "kind": "TypeWitness", - "name": "SubSequence", - "printedName": "SubSequence", - "children": [ - { - "kind": "TypeNominal", - "name": "Slice", - "printedName": "Swift.Slice.Ranges>", - "children": [ - { - "kind": "TypeNominal", - "name": "Ranges", - "printedName": "Swift.RangeSet<τ_0_0>.Ranges", - "usr": "s:s8RangeSetV6RangesV" - } - ], - "usr": "s:s5SliceV" - } - ] - }, - { - "kind": "TypeWitness", - "name": "Indices", - "printedName": "Indices", - "children": [ - { - "kind": "TypeNominal", - "name": "Range", - "printedName": "Swift.Range", - "children": [ - { - "kind": "TypeNominal", - "name": "Int", - "printedName": "Swift.Int", - "usr": "s:Si" - } - ], - "usr": "s:Sn" - } - ] - } - ], - "usr": "s:SK", - "isABIPlaceholder": true - }, - { - "kind": "Conformance", - "name": "Collection", - "printedName": "Collection", - "children": [ - { - "kind": "TypeWitness", - "name": "Element", - "printedName": "Element", - "children": [ - { - "kind": "TypeNominal", - "name": "Range", - "printedName": "Swift.Range<τ_0_0>", - "children": [ - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "τ_0_0" - } - ], - "usr": "s:Sn" - } - ] - }, - { - "kind": "TypeWitness", - "name": "Index", - "printedName": "Index", - "children": [ - { - "kind": "TypeNominal", - "name": "Int", - "printedName": "Swift.Int", - "usr": "s:Si" - } - ] - }, - { - "kind": "TypeWitness", - "name": "Iterator", - "printedName": "Iterator", - "children": [ - { - "kind": "TypeNominal", - "name": "IndexingIterator", - "printedName": "Swift.IndexingIterator.Ranges>", - "children": [ - { - "kind": "TypeNominal", - "name": "Ranges", - "printedName": "Swift.RangeSet<τ_0_0>.Ranges", - "usr": "s:s8RangeSetV6RangesV" - } - ], - "usr": "s:s16IndexingIteratorV" - } - ] - }, - { - "kind": "TypeWitness", - "name": "SubSequence", - "printedName": "SubSequence", - "children": [ - { - "kind": "TypeNominal", - "name": "Slice", - "printedName": "Swift.Slice.Ranges>", - "children": [ - { - "kind": "TypeNominal", - "name": "Ranges", - "printedName": "Swift.RangeSet<τ_0_0>.Ranges", - "usr": "s:s8RangeSetV6RangesV" - } - ], - "usr": "s:s5SliceV" - } - ] - }, - { - "kind": "TypeWitness", - "name": "Indices", - "printedName": "Indices", - "children": [ - { - "kind": "TypeNominal", - "name": "Range", - "printedName": "Swift.Range", - "children": [ - { - "kind": "TypeNominal", - "name": "Int", - "printedName": "Swift.Int", - "usr": "s:Si" - } - ], - "usr": "s:Sn" - } - ] - } - ], - "usr": "s:Sl", - "isABIPlaceholder": true - }, - { - "kind": "Conformance", - "name": "Sequence", - "printedName": "Sequence", - "children": [ - { - "kind": "TypeWitness", - "name": "Element", - "printedName": "Element", - "children": [ - { - "kind": "TypeNominal", - "name": "Range", - "printedName": "Swift.Range<τ_0_0>", - "children": [ - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "τ_0_0" - } - ], - "usr": "s:Sn" - } - ] - }, - { - "kind": "TypeWitness", - "name": "Iterator", - "printedName": "Iterator", - "children": [ - { - "kind": "TypeNominal", - "name": "IndexingIterator", - "printedName": "Swift.IndexingIterator.Ranges>", - "children": [ - { - "kind": "TypeNominal", - "name": "Ranges", - "printedName": "Swift.RangeSet<τ_0_0>.Ranges", - "usr": "s:s8RangeSetV6RangesV" - } - ], - "usr": "s:s16IndexingIteratorV" - } - ] - } - ], - "usr": "s:ST", - "isABIPlaceholder": true - } - ] - }, - { - "kind": "Var", - "name": "ranges", - "printedName": "ranges", - "children": [ - { - "kind": "TypeNominal", - "name": "Ranges", - "printedName": "Swift.RangeSet<τ_0_0>.Ranges", - "usr": "s:s8RangeSetV6RangesV" - } - ], - "declKind": "Var", - "usr": "s:s8RangeSetV6rangesAB6RangesVyx_Gvp", - "moduleName": "Swift", - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", - "accessors": [ - { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", - "children": [ - { - "kind": "TypeNominal", - "name": "Ranges", - "printedName": "Swift.RangeSet<τ_0_0>.Ranges", - "usr": "s:s8RangeSetV6RangesV" - } - ], - "declKind": "Accessor", - "usr": "s:s8RangeSetV6rangesAB6RangesVyx_Gvg", - "moduleName": "Swift", - "genericSig": "<τ_0_0 where τ_0_0 : Swift.Comparable>", - "sugared_genericSig": "", - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", - "accessorKind": "get" - } - ] - }, - { - "kind": "Constructor", - "name": "init", - "printedName": "init(_:within:)", - "children": [ - { - "kind": "TypeNominal", - "name": "RangeSet", - "printedName": "Swift.RangeSet<τ_0_0>", - "children": [ - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "τ_0_0" - } - ], - "usr": "s:s8RangeSetV" - }, - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "τ_1_0" - }, - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "τ_1_1" - } - ], - "declKind": "Constructor", - "usr": "s:s8RangeSetV_6withinAByxGqd___qd_0_tc7ElementQyd__RszSTRd__SlRd_0_5IndexQyd_0_AFRSr0_lufc", - "moduleName": "Swift", - "genericSig": "<τ_0_0, τ_1_0, τ_1_1 where τ_0_0 == τ_1_0.Element, τ_1_0 : Swift.Sequence, τ_1_1 : Swift.Collection, τ_1_0.Element == τ_1_1.Index>", - "sugared_genericSig": "", - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", - "declAttributes": [ - "Inlinable" - ], - "init_kind": "Designated" - }, - { - "kind": "Function", - "name": "insert", - "printedName": "insert(_:within:)", - "children": [ - { - "kind": "TypeNominal", - "name": "Void", - "printedName": "()" - }, - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "τ_0_0" - }, - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "τ_1_0" - } - ], - "declKind": "Func", - "usr": "s:s8RangeSetV6insert_6withinyx_qd__t5IndexQyd__RszSlRd__lF", - "moduleName": "Swift", - "genericSig": "<τ_0_0, τ_1_0 where τ_0_0 == τ_1_0.Index, τ_1_0 : Swift.Collection>", - "sugared_genericSig": "", - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", - "declAttributes": [ - "Inlinable" - ], - "funcSelfKind": "Mutating" - }, - { - "kind": "Function", - "name": "remove", - "printedName": "remove(_:within:)", - "children": [ - { - "kind": "TypeNominal", - "name": "Void", - "printedName": "()" - }, - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "τ_0_0" - }, - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "τ_1_0" - } - ], - "declKind": "Func", - "usr": "s:s8RangeSetV6remove_6withinyx_qd__t5IndexQyd__RszSlRd__lF", - "moduleName": "Swift", - "genericSig": "<τ_0_0, τ_1_0 where τ_0_0 == τ_1_0.Index, τ_1_0 : Swift.Collection>", - "sugared_genericSig": "", - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", - "declAttributes": [ - "Inlinable" - ], - "funcSelfKind": "Mutating" - }, - { - "kind": "Function", - "name": "formUnion", - "printedName": "formUnion(_:)", - "children": [ - { - "kind": "TypeNominal", - "name": "Void", - "printedName": "()" - }, - { - "kind": "TypeNominal", - "name": "RangeSet", - "printedName": "Swift.RangeSet<τ_0_0>", - "children": [ - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "τ_0_0" - } - ], - "paramValueOwnership": "Owned", - "usr": "s:s8RangeSetV" - } - ], - "declKind": "Func", - "usr": "s:s8RangeSetV9formUnionyyAByxGnF", - "moduleName": "Swift", - "genericSig": "<τ_0_0 where τ_0_0 : Swift.Comparable>", - "sugared_genericSig": "", - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", - "funcSelfKind": "Mutating" - }, - { - "kind": "Function", - "name": "formIntersection", - "printedName": "formIntersection(_:)", - "children": [ - { - "kind": "TypeNominal", - "name": "Void", - "printedName": "()" - }, - { - "kind": "TypeNominal", - "name": "RangeSet", - "printedName": "Swift.RangeSet<τ_0_0>", - "children": [ - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "τ_0_0" - } - ], - "usr": "s:s8RangeSetV" - } - ], - "declKind": "Func", - "usr": "s:s8RangeSetV16formIntersectionyyAByxGF", - "moduleName": "Swift", - "genericSig": "<τ_0_0 where τ_0_0 : Swift.Comparable>", - "sugared_genericSig": "", - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", - "funcSelfKind": "Mutating" - }, - { - "kind": "Function", - "name": "formSymmetricDifference", - "printedName": "formSymmetricDifference(_:)", - "children": [ - { - "kind": "TypeNominal", - "name": "Void", - "printedName": "()" - }, - { - "kind": "TypeNominal", - "name": "RangeSet", - "printedName": "Swift.RangeSet<τ_0_0>", - "children": [ - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "τ_0_0" - } - ], - "paramValueOwnership": "Owned", - "usr": "s:s8RangeSetV" - } - ], - "declKind": "Func", - "usr": "s:s8RangeSetV23formSymmetricDifferenceyyAByxGnF", - "moduleName": "Swift", - "genericSig": "<τ_0_0 where τ_0_0 : Swift.Comparable>", - "sugared_genericSig": "", - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", - "funcSelfKind": "Mutating" - }, - { - "kind": "Function", - "name": "subtract", - "printedName": "subtract(_:)", - "children": [ - { - "kind": "TypeNominal", - "name": "Void", - "printedName": "()" - }, - { - "kind": "TypeNominal", - "name": "RangeSet", - "printedName": "Swift.RangeSet<τ_0_0>", - "children": [ - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "τ_0_0" - } - ], - "usr": "s:s8RangeSetV" - } - ], - "declKind": "Func", - "usr": "s:s8RangeSetV8subtractyyAByxGF", - "moduleName": "Swift", - "genericSig": "<τ_0_0 where τ_0_0 : Swift.Comparable>", - "sugared_genericSig": "", - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", - "funcSelfKind": "Mutating" - }, - { - "kind": "Function", - "name": "union", - "printedName": "union(_:)", - "children": [ - { - "kind": "TypeNominal", - "name": "RangeSet", - "printedName": "Swift.RangeSet<τ_0_0>", - "children": [ - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "τ_0_0" - } - ], - "usr": "s:s8RangeSetV" - }, - { - "kind": "TypeNominal", - "name": "RangeSet", - "printedName": "Swift.RangeSet<τ_0_0>", - "children": [ - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "τ_0_0" - } - ], - "paramValueOwnership": "Owned", - "usr": "s:s8RangeSetV" - } - ], - "declKind": "Func", - "usr": "s:s8RangeSetV5unionyAByxGADnF", - "moduleName": "Swift", - "genericSig": "<τ_0_0 where τ_0_0 : Swift.Comparable>", - "sugared_genericSig": "", - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", - "funcSelfKind": "__Consuming" - }, - { - "kind": "Function", - "name": "intersection", - "printedName": "intersection(_:)", - "children": [ - { - "kind": "TypeNominal", - "name": "RangeSet", - "printedName": "Swift.RangeSet<τ_0_0>", - "children": [ - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "τ_0_0" - } - ], - "usr": "s:s8RangeSetV" - }, - { - "kind": "TypeNominal", - "name": "RangeSet", - "printedName": "Swift.RangeSet<τ_0_0>", - "children": [ - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "τ_0_0" - } - ], - "usr": "s:s8RangeSetV" - } - ], - "declKind": "Func", - "usr": "s:s8RangeSetV12intersectionyAByxGADF", - "moduleName": "Swift", - "genericSig": "<τ_0_0 where τ_0_0 : Swift.Comparable>", - "sugared_genericSig": "", - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", - "funcSelfKind": "__Consuming" - }, - { - "kind": "Function", - "name": "symmetricDifference", - "printedName": "symmetricDifference(_:)", - "children": [ - { - "kind": "TypeNominal", - "name": "RangeSet", - "printedName": "Swift.RangeSet<τ_0_0>", - "children": [ - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "τ_0_0" - } - ], - "usr": "s:s8RangeSetV" - }, - { - "kind": "TypeNominal", - "name": "RangeSet", - "printedName": "Swift.RangeSet<τ_0_0>", - "children": [ - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "τ_0_0" - } - ], - "paramValueOwnership": "Owned", - "usr": "s:s8RangeSetV" - } - ], - "declKind": "Func", - "usr": "s:s8RangeSetV19symmetricDifferenceyAByxGADnF", - "moduleName": "Swift", - "genericSig": "<τ_0_0 where τ_0_0 : Swift.Comparable>", - "sugared_genericSig": "", - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", - "funcSelfKind": "__Consuming" - }, - { - "kind": "Function", - "name": "subtracting", - "printedName": "subtracting(_:)", - "children": [ - { - "kind": "TypeNominal", - "name": "RangeSet", - "printedName": "Swift.RangeSet<τ_0_0>", - "children": [ - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "τ_0_0" - } - ], - "usr": "s:s8RangeSetV" - }, - { - "kind": "TypeNominal", - "name": "RangeSet", - "printedName": "Swift.RangeSet<τ_0_0>", - "children": [ - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "τ_0_0" - } - ], - "usr": "s:s8RangeSetV" - } - ], - "declKind": "Func", - "usr": "s:s8RangeSetV11subtractingyAByxGADF", - "moduleName": "Swift", - "genericSig": "<τ_0_0 where τ_0_0 : Swift.Comparable>", - "sugared_genericSig": "", - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", - "funcSelfKind": "NonMutating" - }, - { - "kind": "Function", - "name": "isSubset", - "printedName": "isSubset(of:)", - "children": [ - { - "kind": "TypeNominal", - "name": "Bool", - "printedName": "Swift.Bool", - "usr": "s:Sb" - }, - { - "kind": "TypeNominal", - "name": "RangeSet", - "printedName": "Swift.RangeSet<τ_0_0>", - "children": [ - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "τ_0_0" - } - ], - "usr": "s:s8RangeSetV" - } - ], - "declKind": "Func", - "usr": "s:s8RangeSetV8isSubset2ofSbAByxG_tF", - "moduleName": "Swift", - "genericSig": "<τ_0_0 where τ_0_0 : Swift.Comparable>", - "sugared_genericSig": "", - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", - "funcSelfKind": "NonMutating" - }, - { - "kind": "Function", - "name": "isSuperset", - "printedName": "isSuperset(of:)", - "children": [ - { - "kind": "TypeNominal", - "name": "Bool", - "printedName": "Swift.Bool", - "usr": "s:Sb" - }, - { - "kind": "TypeNominal", - "name": "RangeSet", - "printedName": "Swift.RangeSet<τ_0_0>", - "children": [ - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "τ_0_0" - } - ], - "usr": "s:s8RangeSetV" - } - ], - "declKind": "Func", - "usr": "s:s8RangeSetV10isSuperset2ofSbAByxG_tF", - "moduleName": "Swift", - "genericSig": "<τ_0_0 where τ_0_0 : Swift.Comparable>", - "sugared_genericSig": "", - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", - "funcSelfKind": "NonMutating" - }, - { - "kind": "Function", - "name": "isStrictSubset", - "printedName": "isStrictSubset(of:)", - "children": [ - { - "kind": "TypeNominal", - "name": "Bool", - "printedName": "Swift.Bool", - "usr": "s:Sb" - }, - { - "kind": "TypeNominal", - "name": "RangeSet", - "printedName": "Swift.RangeSet<τ_0_0>", - "children": [ - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "τ_0_0" - } - ], - "usr": "s:s8RangeSetV" - } - ], - "declKind": "Func", - "usr": "s:s8RangeSetV14isStrictSubset2ofSbAByxG_tF", - "moduleName": "Swift", - "genericSig": "<τ_0_0 where τ_0_0 : Swift.Comparable>", - "sugared_genericSig": "", - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", - "funcSelfKind": "NonMutating" - }, - { - "kind": "Function", - "name": "isStrictSuperset", - "printedName": "isStrictSuperset(of:)", - "children": [ - { - "kind": "TypeNominal", - "name": "Bool", - "printedName": "Swift.Bool", - "usr": "s:Sb" - }, - { - "kind": "TypeNominal", - "name": "RangeSet", - "printedName": "Swift.RangeSet<τ_0_0>", - "children": [ - { - "kind": "TypeNominal", - "name": "GenericTypeParam", - "printedName": "τ_0_0" - } - ], - "usr": "s:s8RangeSetV" - } - ], - "declKind": "Func", - "usr": "s:s8RangeSetV16isStrictSuperset2ofSbAByxG_tF", - "moduleName": "Swift", - "genericSig": "<τ_0_0 where τ_0_0 : Swift.Comparable>", - "sugared_genericSig": "", - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", - "funcSelfKind": "NonMutating" - }, - { - "kind": "Var", - "name": "description", - "printedName": "description", - "children": [ - { - "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" - } - ], - "declKind": "Var", - "usr": "s:s8RangeSetV11descriptionSSvp", - "moduleName": "Swift", - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", - "accessors": [ - { - "kind": "Accessor", - "name": "Get", - "printedName": "Get()", - "children": [ - { - "kind": "TypeNominal", - "name": "String", - "printedName": "Swift.String", - "usr": "s:SS" - } - ], - "declKind": "Accessor", - "usr": "s:s8RangeSetV11descriptionSSvg", - "moduleName": "Swift", - "genericSig": "<τ_0_0 where τ_0_0 : Swift.Comparable>", - "sugared_genericSig": "", - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", - "accessorKind": "get" - } - ] - } - ], - "declKind": "Struct", - "usr": "s:s8RangeSetV", - "moduleName": "Swift", - "genericSig": "<τ_0_0 where τ_0_0 : Swift.Comparable>", - "sugared_genericSig": "", - "isABIPlaceholder": true, - "intro_Macosx": "9999", - "intro_iOS": "9999", - "intro_tvOS": "9999", - "intro_watchOS": "9999", - "declAttributes": [ - "Available", - "Available", - "Available", - "Available" - ], - "conformances": [ - { - "kind": "Conformance", - "name": "Equatable", - "printedName": "Equatable", - "usr": "s:SQ", - "isABIPlaceholder": true - }, - { - "kind": "Conformance", - "name": "Hashable", - "printedName": "Hashable", - "usr": "s:SH", - "isABIPlaceholder": true - }, - { - "kind": "Conformance", - "name": "CustomStringConvertible", - "printedName": "CustomStringConvertible", - "usr": "s:s23CustomStringConvertibleP", - "isABIPlaceholder": true - } - ] - }, { "kind": "TypeDecl", "name": "_SliceBuffer", From 322931457cf65c87746e36cb430ec3b8c78aabf6 Mon Sep 17 00:00:00 2001 From: Jeremy Schonfeld Date: Tue, 14 Nov 2023 15:38:55 -0500 Subject: [PATCH 05/17] Fix Constaints/members.swift failure on linux --- test/Constraints/members.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/test/Constraints/members.swift b/test/Constraints/members.swift index b3f2be5086455..db5f6fae4b443 100644 --- a/test/Constraints/members.swift +++ b/test/Constraints/members.swift @@ -634,6 +634,7 @@ func rdar_50467583_and_50909555() { // expected-note@-2 {{found candidate with type '(Int) -> Int'}} // expected-note@-3 {{found candidate with type '(Range) -> ArraySlice'}} // expected-note@-4 {{found candidate with type '((UnboundedRange_) -> ()) -> ArraySlice'}} + // expected-note@-5 * {{found candidate with type '(RangeSet.Index>) -> DiscontiguousSlice<[Int]>' (aka '(RangeSet) -> DiscontiguousSlice>')}} } // rdar://problem/50909555 From e1c3cd80b1873c19fbf7329737834408d615a6e8 Mon Sep 17 00:00:00 2001 From: Jeremy Schonfeld Date: Tue, 14 Nov 2023 16:06:45 -0500 Subject: [PATCH 06/17] Add exceptions to ABI/source checker to fix macOS tests --- .../stability-stdlib-source-x86_64.swift.expected | 9 ++++++--- .../stability-stdlib-abi-without-asserts.test | 15 +++++++++++++++ 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/test/api-digester/Outputs/stability-stdlib-source-x86_64.swift.expected b/test/api-digester/Outputs/stability-stdlib-source-x86_64.swift.expected index 3a93963485761..6217f2a244789 100644 --- a/test/api-digester/Outputs/stability-stdlib-source-x86_64.swift.expected +++ b/test/api-digester/Outputs/stability-stdlib-source-x86_64.swift.expected @@ -1,10 +1,13 @@ -Accessor MutableCollection.subscript(_:).Get() has generic signature change from to > -Accessor MutableCollection.subscript(_:).Set() has generic signature change from to > +Accessor MutableCollection.subscript(_:).Get() has parameter 0 type change from Swift.Range to Swift.RangeSet +Accessor MutableCollection.subscript(_:).Get() has return type change from Swift.Slice to Swift.DiscontiguousSlice +Accessor MutableCollection.subscript(_:).Set() has parameter 0 type change from Swift.Slice to Swift.DiscontiguousSlice +Accessor MutableCollection.subscript(_:).Set() has parameter 1 type change from Swift.Range to Swift.RangeSet Protocol CodingKey has added inherited protocol Sendable Protocol CodingKey has generic signature change from to Protocol Error has added inherited protocol Sendable Protocol Error has generic signature change from to -Subscript MutableCollection.subscript(_:) has generic signature change from to > +Subscript MutableCollection.subscript(_:) has parameter 0 type change from Swift.Range to Swift.RangeSet +Subscript MutableCollection.subscript(_:) has return type change from Swift.Slice to Swift.DiscontiguousSlice // Not actually a source break; the typechecker will find these operations on // FixedWidthInteger instead. diff --git a/test/api-digester/stability-stdlib-abi-without-asserts.test b/test/api-digester/stability-stdlib-abi-without-asserts.test index 342e3e78f2a9b..a98ed431158e1 100644 --- a/test/api-digester/stability-stdlib-abi-without-asserts.test +++ b/test/api-digester/stability-stdlib-abi-without-asserts.test @@ -132,4 +132,19 @@ Func ContiguousArray._createNewBuffer(bufferIsUnique:minimumCapacity:growForAppe Func ContiguousArray._reserveCapacityImpl(minimumCapacity:growForAppend:) has been renamed to Func __specialize_class__reserveCapacityImpl(minimumCapacity:growForAppend:) Func ContiguousArray._reserveCapacityImpl(minimumCapacity:growForAppend:) has mangled name changing from 'Swift.ContiguousArray._reserveCapacityImpl(minimumCapacity: Swift.Int, growForAppend: Swift.Bool) -> ()' to 'Swift.ContiguousArray.__specialize_class__reserveCapacityImpl(minimumCapacity: Swift.Int, growForAppend: Swift.Bool) -> ()' +// These haven't actually been changed, rather a new subscript was added. +// But it seems the ABI checker gives a false positive here and detects +// it as a rename instead of an addition +Accessor MutableCollection.subscript(_:).Get() has mangled name changing from '(extension in Swift):Swift.MutableCollection.subscript.getter : (Swift.Range) -> Swift.Slice' to '(extension in Swift):Swift.MutableCollection.subscript.getter : (Swift.RangeSet) -> Swift.DiscontiguousSlice' +Accessor MutableCollection.subscript(_:).Get() has parameter 0 type change from Swift.Range<τ_0_0.Index> to Swift.RangeSet<τ_0_0.Index> +Accessor MutableCollection.subscript(_:).Get() has return type change from Swift.Slice<τ_0_0> to Swift.DiscontiguousSlice<τ_0_0> +Accessor MutableCollection.subscript(_:).Modify() has mangled name changing from '(extension in Swift):Swift.MutableCollection.subscript.modify : (Swift.Range) -> Swift.Slice' to '(extension in Swift):Swift.MutableCollection.subscript.modify : (Swift.RangeSet) -> Swift.DiscontiguousSlice' +Accessor MutableCollection.subscript(_:).Modify() has parameter 0 type change from Swift.Range<τ_0_0.Index> to Swift.RangeSet<τ_0_0.Index> +Accessor MutableCollection.subscript(_:).Set() has mangled name changing from '(extension in Swift):Swift.MutableCollection.subscript.setter : (Swift.Range) -> Swift.Slice' to '(extension in Swift):Swift.MutableCollection.subscript.setter : (Swift.RangeSet) -> Swift.DiscontiguousSlice' +Accessor MutableCollection.subscript(_:).Set() has parameter 0 type change from Swift.Slice<τ_0_0> to Swift.DiscontiguousSlice<τ_0_0> +Accessor MutableCollection.subscript(_:).Set() has parameter 1 type change from Swift.Range<τ_0_0.Index> to Swift.RangeSet<τ_0_0.Index> +Subscript MutableCollection.subscript(_:) has mangled name changing from '(extension in Swift):Swift.MutableCollection.subscript(Swift.Range) -> Swift.Slice' to '(extension in Swift):Swift.MutableCollection.subscript(Swift.RangeSet) -> Swift.DiscontiguousSlice' +Subscript MutableCollection.subscript(_:) has parameter 0 type change from Swift.Range<τ_0_0.Index> to Swift.RangeSet<τ_0_0.Index> +Subscript MutableCollection.subscript(_:) has return type change from Swift.Slice<τ_0_0> to Swift.DiscontiguousSlice<τ_0_0> + // *** DO NOT DISABLE OR XFAIL THIS TEST. *** (See comment above.) From 642bf3c7f6a3a2dfddacd75bfc31e0a3e2c3047a Mon Sep 17 00:00:00 2001 From: Jeremy Schonfeld Date: Wed, 15 Nov 2023 15:56:03 -0500 Subject: [PATCH 07/17] Fix incremental dependency test failure --- test/Incremental/Verifier/single-file-private/AnyObject.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/test/Incremental/Verifier/single-file-private/AnyObject.swift b/test/Incremental/Verifier/single-file-private/AnyObject.swift index bba1ce19a2245..ae4d66e41d8e7 100644 --- a/test/Incremental/Verifier/single-file-private/AnyObject.swift +++ b/test/Incremental/Verifier/single-file-private/AnyObject.swift @@ -29,6 +29,7 @@ import Foundation // expected-member {{ObjectiveC.NSObject.Bool}} // expected-conformance {{Swift.Hashable}} // expected-conformance {{Swift.Equatable}} +// expected-conformance {{Swift.Sequence}} // expected-member {{Swift._ExpressibleByBuiltinIntegerLiteral.init}} @objc private class LookupFactory: NSObject { // expected-provides {{AssignmentPrecedence}} From df6b4c9837e7046151fc9854f5130a22503a1250 Mon Sep 17 00:00:00 2001 From: Jeremy Schonfeld Date: Mon, 27 Nov 2023 18:08:30 -0500 Subject: [PATCH 08/17] Remove inlining/unfreeze implementation for future improvements --- stdlib/public/core/DiscontiguousSlice.swift | 31 -------------------- stdlib/public/core/RangeSet.swift | 32 --------------------- stdlib/public/core/RangeSetRanges.swift | 10 ------- 3 files changed, 73 deletions(-) diff --git a/stdlib/public/core/DiscontiguousSlice.swift b/stdlib/public/core/DiscontiguousSlice.swift index e826045348b4a..f4f92bbee494e 100644 --- a/stdlib/public/core/DiscontiguousSlice.swift +++ b/stdlib/public/core/DiscontiguousSlice.swift @@ -13,21 +13,17 @@ /// A collection wrapper that provides access to the elements of a collection, /// indexed by a set of indices. @available(SwiftStdlib 5.11, *) -@frozen public struct DiscontiguousSlice { - @usableFromInline internal var _base: Base /// The set of subranges that are available through this discontiguous slice. public let subranges: RangeSet /// The collection that the indexed collection wraps. - @inlinable public var base: Base { return _base } - @inlinable internal init(_base: Base, subranges: RangeSet) { self._base = _base self.subranges = subranges @@ -40,7 +36,6 @@ where Base: Sendable, Base.Index: Sendable {} @available(SwiftStdlib 5.11, *) extension DiscontiguousSlice: Equatable where Base.Element: Equatable { - @inlinable public static func ==(lhs: Self, rhs: Self) -> Bool { lhs.elementsEqual(rhs) } @@ -48,7 +43,6 @@ extension DiscontiguousSlice: Equatable where Base.Element: Equatable { @available(SwiftStdlib 5.11, *) extension DiscontiguousSlice: Hashable where Base.Element: Hashable { - @inlinable public func hash(into hasher: inout Hasher) { var count = 0 for element in self { @@ -69,16 +63,13 @@ extension DiscontiguousSlice: CustomStringConvertible { @available(SwiftStdlib 5.11, *) extension DiscontiguousSlice { /// A position in a `DiscontiguousSlice`. - @frozen public struct Index { /// The index of the range that contains `base`. - @usableFromInline internal let _rangeOffset: Int /// The position of this index in the base collection. public let base: Base.Index - @inlinable internal init(_rangeOffset: Int, base: Base.Index) { self._rangeOffset = _rangeOffset self.base = base @@ -88,7 +79,6 @@ extension DiscontiguousSlice { @available(SwiftStdlib 5.11, *) extension DiscontiguousSlice.Index: Equatable { - @inlinable public static func == (left: Self, right: Self) -> Bool { left.base == right.base } @@ -96,7 +86,6 @@ extension DiscontiguousSlice.Index: Equatable { @available(SwiftStdlib 5.11, *) extension DiscontiguousSlice.Index: Hashable where Base.Index: Hashable { - @inlinable public func hash(into hasher: inout Hasher) { hasher.combine(base) } @@ -104,7 +93,6 @@ extension DiscontiguousSlice.Index: Hashable where Base.Index: Hashable { @available(SwiftStdlib 5.11, *) extension DiscontiguousSlice.Index: Comparable { - @inlinable public static func < (left: Self, right: Self) -> Bool { left.base < right.base } @@ -128,12 +116,10 @@ extension DiscontiguousSlice: Sequence { public typealias Element = Base.Element public typealias Iterator = IndexingIterator - @inlinable public func _customContainsEquatableElement(_ element: Element) -> Bool? { _customIndexOfEquatableElement(element).map { $0 != nil } } - @inlinable public __consuming func _copyToContiguousArray() -> ContiguousArray { var result: ContiguousArray = [] for range in subranges.ranges { @@ -148,19 +134,16 @@ extension DiscontiguousSlice: Collection { public typealias SubSequence = Self public typealias Indices = DefaultIndices - @inlinable public var startIndex: Index { subranges.isEmpty ? endIndex : Index(_rangeOffset: 0, base: subranges.ranges[0].lowerBound) } - @inlinable public var endIndex: Index { Index(_rangeOffset: subranges.ranges.endIndex, base: _base.endIndex) } - @inlinable public var count: Int { var c = 0 for range in subranges.ranges { @@ -169,12 +152,10 @@ extension DiscontiguousSlice: Collection { return c } - @inlinable public var isEmpty: Bool { subranges.isEmpty } - @inlinable public func distance(from start: Index, to end: Index) -> Int { let ranges = subranges.ranges[start._rangeOffset ... end._rangeOffset] guard ranges.count > 1 else { @@ -192,7 +173,6 @@ extension DiscontiguousSlice: Collection { return head + middle + tail } - @inlinable public func index(after i: Index) -> Index { // Note: index validation performed by the underlying collections only let currentRange = subranges.ranges[i._rangeOffset] @@ -210,13 +190,11 @@ extension DiscontiguousSlice: Collection { _rangeOffset: nextOffset, base: subranges.ranges[nextOffset].lowerBound) } - @inlinable public subscript(i: Index) -> Base.Element { // Note: index validation performed by the base collection only _base[subranges.ranges[i._rangeOffset]][i.base] } - @inlinable public subscript(bounds: Range) -> DiscontiguousSlice { let baseBounds = bounds.lowerBound.base ..< bounds.upperBound.base let baseSlice = base[baseBounds] @@ -225,7 +203,6 @@ extension DiscontiguousSlice: Collection { return DiscontiguousSlice(_base: base, subranges: subset) } - @usableFromInline internal func _index(of baseIndex: Base.Index) -> Index? { let rangeOffset = subranges.ranges ._partitioningIndex { $0.upperBound >= baseIndex } @@ -236,7 +213,6 @@ extension DiscontiguousSlice: Collection { return Index(_rangeOffset: rangeOffset, base: baseIndex) } - @inlinable public func _customIndexOfEquatableElement(_ element: Element) -> Index?? { var definite = true for (i, range) in subranges.ranges.enumerated() { @@ -257,7 +233,6 @@ extension DiscontiguousSlice: Collection { } } - @inlinable public func _customLastIndexOfEquatableElement(_ element: Element) -> Index?? { var definite = true for (i, range) in subranges.ranges.enumerated().reversed() { @@ -278,7 +253,6 @@ extension DiscontiguousSlice: Collection { } } - @inlinable public func _failEarlyRangeCheck(_ index: Index, bounds: Range) { let baseBounds = bounds.lowerBound.base ..< bounds.upperBound.base let offsetBounds = bounds.lowerBound._rangeOffset ..< @@ -292,7 +266,6 @@ extension DiscontiguousSlice: Collection { } } - @inlinable public func _failEarlyRangeCheck(_ index: Index, bounds: ClosedRange) { let baseBounds = bounds.lowerBound.base ... bounds.upperBound.base let offsetBounds = bounds.lowerBound._rangeOffset ... @@ -306,7 +279,6 @@ extension DiscontiguousSlice: Collection { } } - @inlinable public func _failEarlyRangeCheck(_ range: Range, bounds: Range) { let baseBounds = bounds.lowerBound.base ..< bounds.upperBound.base let baseRange = range.lowerBound.base ..< range.upperBound.base @@ -339,7 +311,6 @@ extension DiscontiguousSlice: Collection { extension DiscontiguousSlice: BidirectionalCollection where Base: BidirectionalCollection { - @inlinable public func index(before i: Index) -> Index { _precondition(i > startIndex, "Can't move index before startIndex") @@ -381,7 +352,6 @@ extension DiscontiguousSlice where Base: MutableCollection { /// `endIndex` property. /// /// - Complexity: O(1) - @inlinable public subscript(i: Index) -> Base.Element { get { _base[subranges.ranges[i._rangeOffset]][i.base] @@ -404,7 +374,6 @@ extension Collection { /// /// - Complexity: O(1) @available(SwiftStdlib 5.11, *) - @inlinable public subscript(subranges: RangeSet) -> DiscontiguousSlice { DiscontiguousSlice(_base: self, subranges: subranges) } diff --git a/stdlib/public/core/RangeSet.swift b/stdlib/public/core/RangeSet.swift index 7052fe8cce36a..4382d1484533a 100644 --- a/stdlib/public/core/RangeSet.swift +++ b/stdlib/public/core/RangeSet.swift @@ -27,22 +27,18 @@ /// numbers.moveSubranges(negativeSubranges, to: 0) /// // numbers == [-5, -3, -9, 10, 12, 14, 15] @available(SwiftStdlib 5.11, *) -@frozen public struct RangeSet { - @usableFromInline internal var _ranges: Ranges /// A collection of the ranges that make up the range set. /// /// The ranges that you access by using `ranges` never overlap, are never /// empty, and are always in increasing order. - @inlinable public var ranges: Ranges { return _ranges } /// Creates an empty range set. - @inlinable public init() { _ranges = Ranges() } @@ -50,7 +46,6 @@ public struct RangeSet { /// Creates a range set containing the given range. /// /// - Parameter range: The range to use for the new range set. - @inlinable public init(_ range: Range) { if !range.isEmpty { self._ranges = Ranges(_range: range) @@ -67,7 +62,6 @@ public struct RangeSet { /// passed to this initializer. /// /// - Parameter ranges: The ranges to use for the new range set. - @inlinable public init(_ ranges: S) where S.Element == Range { self.init() for range in ranges { @@ -75,7 +69,6 @@ public struct RangeSet { } } - @inlinable internal init(_ranges: Ranges) { self._ranges = _ranges } @@ -87,7 +80,6 @@ public struct RangeSet { /// or upper bounds. In addition to not overlapping, no two consecutive /// ranges share an upper and lower bound — `[0..<5, 5..<10]` is ill-formed, /// and would instead be represented as `[0..<10]`. - @inlinable internal func _checkInvariants() { for (a, b) in zip(_ranges, _ranges.dropFirst()) { _debugPrecondition(!a.isEmpty && !b.isEmpty, "Empty range in range set") @@ -99,7 +91,6 @@ public struct RangeSet { /// Creates a new range set from `ranges`, which satisfies the range set /// invariants. - @inlinable internal init(_orderedRanges ranges: [Range]) { switch ranges.count { case 0: self._ranges = Ranges() @@ -110,7 +101,6 @@ public struct RangeSet { } /// A Boolean value indicating whether the range set is empty. - @inlinable public var isEmpty: Bool { _ranges.isEmpty } @@ -124,7 +114,6 @@ public struct RangeSet { /// /// - Complexity: O(log *n*), where *n* is the number of ranges in the /// range set. - @inlinable public func contains(_ value: Bound) -> Bool { _ranges._contains(value) } @@ -135,7 +124,6 @@ public struct RangeSet { /// /// - Complexity: O(*n*), where *n* is the number of ranges in the range /// set. - @inlinable public mutating func insert(contentsOf range: Range) { if range.isEmpty { return } _ranges._insert(contentsOf: range) @@ -147,7 +135,6 @@ public struct RangeSet { /// /// - Complexity: O(*n*), where *n* is the number of ranges in the range /// set. - @inlinable public mutating func remove(contentsOf range: Range) { if range.isEmpty { return } _ranges._remove(contentsOf: range) @@ -156,7 +143,6 @@ public struct RangeSet { @available(SwiftStdlib 5.11, *) extension RangeSet: Equatable { - @inlinable public static func == (left: Self, right: Self) -> Bool { left._ranges == right._ranges } @@ -164,7 +150,6 @@ extension RangeSet: Equatable { @available(SwiftStdlib 5.11, *) extension RangeSet: Hashable where Bound: Hashable { - @inlinable public func hash(into hasher: inout Hasher) { hasher.combine(self._ranges) } @@ -184,7 +169,6 @@ extension RangeSet { /// - index: The index to include in the range set. `index` must be a /// valid index of `collection` that isn't the collection's `endIndex`. /// - collection: The collection that contains `index`. - @inlinable public init(_ indices: S, within collection: C) where S: Sequence, C: Collection, S.Element == C.Index, C.Index == Bound { @@ -204,7 +188,6 @@ extension RangeSet { /// /// - Complexity: O(*n*), where *n* is the number of ranges in the range /// set. - @inlinable public mutating func insert(_ index: Bound, within collection: C) where C: Collection, C.Index == Bound { @@ -221,7 +204,6 @@ extension RangeSet { /// /// - Complexity: O(*n*), where *n* is the number of ranges in the range /// set. - @inlinable public mutating func remove(_ index: Bound, within collection: C) where C: Collection, C.Index == Bound { @@ -238,7 +220,6 @@ extension RangeSet { /// /// - Complexity: O(*n*), where *n* is the number of ranges in the range /// set. - @inlinable internal func _inverted(within collection: C) -> RangeSet where C: Collection, C.Index == Bound { @@ -256,7 +237,6 @@ extension RangeSet { /// Adds the contents of the given range set to this range set. /// /// - Parameter other: A range set to merge with this one. - @inlinable public mutating func formUnion(_ other: __owned RangeSet) { for range in other._ranges { insert(contentsOf: range) @@ -267,7 +247,6 @@ extension RangeSet { /// range set. /// /// - Parameter other: A range set to intersect with. - @inlinable public mutating func formIntersection(_ other: RangeSet) { self = self.intersection(other) } @@ -277,7 +256,6 @@ extension RangeSet { /// range set. /// /// - Parameter other: A range set to perform a symmetric difference against. - @inlinable public mutating func formSymmetricDifference( _ other: __owned RangeSet ) { @@ -287,7 +265,6 @@ extension RangeSet { /// Removes the contents of the given range set from this range set. /// /// - Parameter other: A range set to subtract from this one. - @inlinable public mutating func subtract(_ other: RangeSet) { for range in other._ranges { remove(contentsOf: range) @@ -299,7 +276,6 @@ extension RangeSet { /// /// - Parameter other: The range set to merge with this one. /// - Returns: A new range set. - @inlinable public __consuming func union( _ other: __owned RangeSet ) -> RangeSet { @@ -313,7 +289,6 @@ extension RangeSet { /// /// - Parameter other: The range set to merge with this one. /// - Returns: A new range set. - @inlinable public __consuming func intersection( _ other: RangeSet ) -> RangeSet { @@ -325,7 +300,6 @@ extension RangeSet { /// /// - Parameter other: The range set to find a symmetric difference with. /// - Returns: A new range set. - @inlinable public __consuming func symmetricDifference( _ other: __owned RangeSet ) -> RangeSet { @@ -337,7 +311,6 @@ extension RangeSet { /// /// - Parameter other: The range set to subtract. /// - Returns: A new range set. - @inlinable public func subtracting(_ other: RangeSet) -> RangeSet { var result = self result.subtract(other) @@ -350,7 +323,6 @@ extension RangeSet { /// - Parameter other: A range set to compare against. /// - Returns: `true` if this range set is a subset of `other`; /// otherwise, `false`. - @inlinable public func isSubset(of other: RangeSet) -> Bool { self.intersection(other) == self } @@ -361,7 +333,6 @@ extension RangeSet { /// - Parameter other: A range set to compare against. /// - Returns: `true` if this range set is a superset of `other`; /// otherwise, `false`. - @inlinable public func isSuperset(of other: RangeSet) -> Bool { other.isSubset(of: self) } @@ -372,7 +343,6 @@ extension RangeSet { /// - Parameter other: A range set to compare against. /// - Returns: `true` if this range set is a strict subset of `other`; /// otherwise, `false`. - @inlinable public func isStrictSubset(of other: RangeSet) -> Bool { self != other && isSubset(of: other) } @@ -383,7 +353,6 @@ extension RangeSet { /// - Parameter other: A range set to compare against. /// - Returns: `true` if this range set is a strict superset of `other`; /// otherwise, `false`. - @inlinable public func isStrictSuperset(of other: RangeSet) -> Bool { other.isStrictSubset(of: self) } @@ -394,7 +363,6 @@ extension RangeSet { /// - Parameter other: A range set to compare against. /// - Returns: `true` if this range set has no elements in common with /// `other`; otherwise, `false`. - @inlinable public func isDisjoint(_ other: RangeSet) -> Bool { self.intersection(other).isEmpty } diff --git a/stdlib/public/core/RangeSetRanges.swift b/stdlib/public/core/RangeSetRanges.swift index abf8b16423d0c..3fdec63d0c3dc 100644 --- a/stdlib/public/core/RangeSetRanges.swift +++ b/stdlib/public/core/RangeSetRanges.swift @@ -16,22 +16,18 @@ extension RangeSet { public struct Ranges { internal var _storage: [Range] - @usableFromInline internal init() { _storage = [] } - @usableFromInline internal init(_range: Range) { _storage = [_range] } - @usableFromInline internal init(_ranges: [Range]) { _storage = _ranges } - @usableFromInline internal func _contains(_ bound: Bound) -> Bool { let i = _storage._partitioningIndex { $0.upperBound > bound } return i == _storage.endIndex ? false : _storage[i].lowerBound <= bound @@ -95,7 +91,6 @@ extension RangeSet { } // Insert a non-empty range into the storage - @usableFromInline internal mutating func _insert(contentsOf range: Range) { let indices = _indicesOfRange(range, in: _storage) if indices.isEmpty { @@ -111,7 +106,6 @@ extension RangeSet { } // Remove a non-empty range from the storage - @usableFromInline internal mutating func _remove(contentsOf range: Range) { let indices = _indicesOfRange(range, in: _storage, includeAdjacent: false) guard !indices.isEmpty else { @@ -144,7 +138,6 @@ extension RangeSet { /// Returns a that represents the ranges of values within the /// given bounds that aren't represented by this range set. - @usableFromInline internal func _gaps(boundedBy bounds: Range) -> Self { let indices = _indicesOfRange(bounds, in: _storage) guard !indices.isEmpty else { @@ -168,7 +161,6 @@ extension RangeSet { return resultVal } - @usableFromInline internal func _intersection(_ other: Ranges) -> Ranges { let left = self._storage let right = other._storage @@ -242,7 +234,6 @@ extension RangeSet.Ranges : Collection { public typealias Indices = Range public typealias SubSequence = Slice - @inlinable public var startIndex: Index { 0 } @@ -251,7 +242,6 @@ extension RangeSet.Ranges : Collection { _storage.count } - @inlinable public var count: Int { self.endIndex } From 9bf13432f99dee7ea6e8c24ef000446ad81e8c97 Mon Sep 17 00:00:00 2001 From: Jeremy Schonfeld Date: Tue, 28 Nov 2023 16:51:32 -0500 Subject: [PATCH 09/17] Simplify indices(where:) implementation --- stdlib/public/core/CollectionAlgorithms.swift | 27 ++++++------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/stdlib/public/core/CollectionAlgorithms.swift b/stdlib/public/core/CollectionAlgorithms.swift index 53a79634dbd94..7978bef264144 100644 --- a/stdlib/public/core/CollectionAlgorithms.swift +++ b/stdlib/public/core/CollectionAlgorithms.swift @@ -236,27 +236,16 @@ extension Collection { public func indices(where predicate: (Element) throws -> Bool) rethrows -> RangeSet { - if isEmpty { return RangeSet() } - var result: [Range] = [] - var i = startIndex - var start: Index? = nil - while i < endIndex { - if try predicate(self[i]) { - if start == nil { - start = i - } - } else { - if let oldStart = start { - result.append(oldStart ..< i) - start = nil - } - } - formIndex(after: &i) - } + var end = startIndex + while let begin = try self[end...].firstIndex(where: predicate) { + end = try self[begin...].prefix(while: predicate).endIndex + result.append(begin ..< end) - if let start { - result.append(start ..< endIndex) + guard end < self.endIndex else { + break + } + self.formIndex(after: &end) } return RangeSet(_orderedRanges: result) From fbb1ce3a65dcd81e7babdc814600192c439d06ac Mon Sep 17 00:00:00 2001 From: Jeremy Schonfeld Date: Thu, 30 Nov 2023 12:28:23 -0500 Subject: [PATCH 10/17] Address review feedback --- stdlib/public/core/CollectionAlgorithms.swift | 6 +- stdlib/public/core/DiscontiguousSlice.swift | 17 +- stdlib/public/core/RangeSet.swift | 46 +- stdlib/public/core/RangeSetRanges.swift | 407 +++++++++--------- validation-test/stdlib/RangeSet.swift | 33 ++ 5 files changed, 280 insertions(+), 229 deletions(-) diff --git a/stdlib/public/core/CollectionAlgorithms.swift b/stdlib/public/core/CollectionAlgorithms.swift index 7978bef264144..98a36d36e4d9e 100644 --- a/stdlib/public/core/CollectionAlgorithms.swift +++ b/stdlib/public/core/CollectionAlgorithms.swift @@ -233,9 +233,9 @@ extension Collection { /// /// - Complexity: O(*n*), where *n* is the length of the collection. @available(SwiftStdlib 5.11, *) - public func indices(where predicate: (Element) throws -> Bool) rethrows - -> RangeSet - { + public func indices( + where predicate: (Element) throws -> Bool + ) rethrows -> RangeSet { var result: [Range] = [] var end = startIndex while let begin = try self[end...].firstIndex(where: predicate) { diff --git a/stdlib/public/core/DiscontiguousSlice.swift b/stdlib/public/core/DiscontiguousSlice.swift index f4f92bbee494e..5d700b1d4610c 100644 --- a/stdlib/public/core/DiscontiguousSlice.swift +++ b/stdlib/public/core/DiscontiguousSlice.swift @@ -44,12 +44,10 @@ extension DiscontiguousSlice: Equatable where Base.Element: Equatable { @available(SwiftStdlib 5.11, *) extension DiscontiguousSlice: Hashable where Base.Element: Hashable { public func hash(into hasher: inout Hasher) { - var count = 0 + hasher.combine(count) // delimeter; do not remove for element in self { hasher.combine(element) - count += 1 } - hasher.combine(count) // discriminator } } @@ -101,10 +99,7 @@ extension DiscontiguousSlice.Index: Comparable { @available(SwiftStdlib 5.11, *) extension DiscontiguousSlice.Index: CustomStringConvertible { public var description: String { - var d = "" - debugPrint(base, terminator: "", to: &d) - d += " (rangeOffset: \(_rangeOffset))" - return d + "" } } @@ -233,7 +228,9 @@ extension DiscontiguousSlice: Collection { } } - public func _customLastIndexOfEquatableElement(_ element: Element) -> Index?? { + public func _customLastIndexOfEquatableElement( + _ element: Element + ) -> Index?? { var definite = true for (i, range) in subranges.ranges.enumerated().reversed() { guard let baseResult = _base[range] @@ -253,7 +250,9 @@ extension DiscontiguousSlice: Collection { } } - public func _failEarlyRangeCheck(_ index: Index, bounds: Range) { + public func _failEarlyRangeCheck( + _ index: Index, bounds: Range + ) { let baseBounds = bounds.lowerBound.base ..< bounds.upperBound.base let offsetBounds = bounds.lowerBound._rangeOffset ..< bounds.upperBound._rangeOffset diff --git a/stdlib/public/core/RangeSet.swift b/stdlib/public/core/RangeSet.swift index 4382d1484533a..8ad6d1d624b47 100644 --- a/stdlib/public/core/RangeSet.swift +++ b/stdlib/public/core/RangeSet.swift @@ -62,7 +62,7 @@ public struct RangeSet { /// passed to this initializer. /// /// - Parameter ranges: The ranges to use for the new range set. - public init(_ ranges: S) where S.Element == Range { + public init(_ ranges: some Sequence>) { self.init() for range in ranges { insert(contentsOf: range) @@ -169,9 +169,9 @@ extension RangeSet { /// - index: The index to include in the range set. `index` must be a /// valid index of `collection` that isn't the collection's `endIndex`. /// - collection: The collection that contains `index`. - public init(_ indices: S, within collection: C) - where S: Sequence, C: Collection, S.Element == C.Index, C.Index == Bound - { + public init( + _ indices: S, within collection: C + ) where S.Element == C.Index, C.Index == Bound { self.init() for i in indices { self.insert(i, within: collection) @@ -188,9 +188,9 @@ extension RangeSet { /// /// - Complexity: O(*n*), where *n* is the number of ranges in the range /// set. - public mutating func insert(_ index: Bound, within collection: C) - where C: Collection, C.Index == Bound - { + public mutating func insert( + _ index: Bound, within collection: C + ) where C.Index == Bound { insert(contentsOf: index ..< collection.index(after: index)) } @@ -204,9 +204,9 @@ extension RangeSet { /// /// - Complexity: O(*n*), where *n* is the number of ranges in the range /// set. - public mutating func remove(_ index: Bound, within collection: C) - where C: Collection, C.Index == Bound - { + public mutating func remove( + _ index: Bound, within collection: C + ) where C.Index == Bound { remove(contentsOf: index ..< collection.index(after: index)) } @@ -220,9 +220,9 @@ extension RangeSet { /// /// - Complexity: O(*n*), where *n* is the number of ranges in the range /// set. - internal func _inverted(within collection: C) -> RangeSet - where C: Collection, C.Index == Bound - { + internal func _inverted( + within collection: C + ) -> RangeSet where C: Collection, C.Index == Bound { return RangeSet(_ranges: _ranges._gaps( boundedBy: collection.startIndex ..< collection.endIndex)) } @@ -311,7 +311,9 @@ extension RangeSet { /// /// - Parameter other: The range set to subtract. /// - Returns: A new range set. - public func subtracting(_ other: RangeSet) -> RangeSet { + public __consuming func subtracting( + _ other: RangeSet + ) -> RangeSet { var result = self result.subtract(other) return result @@ -324,7 +326,21 @@ extension RangeSet { /// - Returns: `true` if this range set is a subset of `other`; /// otherwise, `false`. public func isSubset(of other: RangeSet) -> Bool { - self.intersection(other) == self + var remaining = other.ranges[...] + for range in ranges { + guard let containingIdx = remaining.firstIndex(where: { + $0.contains(range.lowerBound) + }) else { + return false + } + + if remaining[containingIdx].upperBound < range.upperBound { + return false + } + + remaining = other.ranges[containingIdx...] + } + return true } /// Returns a Boolean value that indicates whether this range set is a diff --git a/stdlib/public/core/RangeSetRanges.swift b/stdlib/public/core/RangeSetRanges.swift index 3fdec63d0c3dc..ec130e9df7ef5 100644 --- a/stdlib/public/core/RangeSetRanges.swift +++ b/stdlib/public/core/RangeSetRanges.swift @@ -14,222 +14,225 @@ extension RangeSet { /// A collection of the ranges that make up a range set. public struct Ranges { - internal var _storage: [Range] + internal var _storage: [Range] - internal init() { - _storage = [] - } - - internal init(_range: Range) { - _storage = [_range] - } - - internal init(_ranges: [Range]) { - _storage = _ranges - } + internal init() { + _storage = [] + } + + internal init(_range: Range) { + _storage = [_range] + } + + internal init(_ranges: [Range]) { + _storage = _ranges + } + } +} - internal func _contains(_ bound: Bound) -> Bool { - let i = _storage._partitioningIndex { $0.upperBound > bound } - return i == _storage.endIndex ? false : _storage[i].lowerBound <= bound - } +@available(SwiftStdlib 5.11, *) +extension RangeSet.Ranges { + internal func _contains(_ bound: Bound) -> Bool { + let i = _storage._partitioningIndex { $0.upperBound > bound } + return i == _storage.endIndex ? false : _storage[i].lowerBound <= bound + } - /// Returns a range indicating the existing ranges that `range` overlaps - /// with. - /// - /// For example, if `self` is `[0..<5, 10..<15, 20..<25, 30..<35]`, then: - /// - /// - `_indicesOfRange(12..<14) == 1..<2` - /// - `_indicesOfRange(12..<19) == 1..<2` - /// - `_indicesOfRange(17..<19) == 2..<2` - /// - `_indicesOfRange(12..<22) == 1..<3` - internal func _indicesOfRange( - _ range: Range, - in subranges: [Range], - includeAdjacent: Bool = true - ) -> Range { - guard subranges.count > 1 else { - if subranges.isEmpty { - return 0 ..< 0 - } else { - let subrange = subranges[0] - if range.upperBound < subrange.lowerBound { - return 0 ..< 0 - } else if range.lowerBound > subrange.upperBound { - return 1 ..< 1 - } else { - return 0 ..< 1 - } - } - } + /// Returns a range indicating the existing ranges that `range` overlaps + /// with. + /// + /// For example, if `self` is `[0..<5, 10..<15, 20..<25, 30..<35]`, then: + /// + /// - `_indicesOfRange(12..<14) == 1..<2` + /// - `_indicesOfRange(12..<19) == 1..<2` + /// - `_indicesOfRange(17..<19) == 2..<2` + /// - `_indicesOfRange(12..<22) == 1..<3` + internal func _indicesOfRange( + _ range: Range, + in subranges: [Range], + includeAdjacent: Bool = true + ) -> Range { + guard subranges.count > 1 else { + if subranges.isEmpty { + return 0 ..< 0 + } else { + let subrange = subranges[0] + if range.upperBound < subrange.lowerBound { + return 0 ..< 0 + } else if range.lowerBound > subrange.upperBound { + return 1 ..< 1 + } else { + return 0 ..< 1 + } + } + } - // The beginning index for the position of `range` is the first range - // with an upper bound larger than `range`'s lower bound. The range - // at this position may or may not overlap `range`. - let beginningIndex = subranges._partitioningIndex { - if includeAdjacent { - $0.upperBound >= range.lowerBound - } else { - $0.upperBound > range.lowerBound - } - } - - // The ending index for `range` is the first range with a lower bound - // greater than `range`'s upper bound. If this is the same as - // `beginningIndex`, than `range` doesn't overlap any of the existing - // ranges. If this is `ranges.endIndex`, then `range` overlaps the - // rest of the ranges. Otherwise, `range` overlaps one or - // more ranges in the set. - let endingIndex = subranges[beginningIndex...]._partitioningIndex { - if includeAdjacent { - $0.lowerBound > range.upperBound - } else { - $0.lowerBound >= range.upperBound - } - } - - return beginningIndex ..< endingIndex - } + // The beginning index for the position of `range` is the first range + // with an upper bound larger than `range`'s lower bound. The range + // at this position may or may not overlap `range`. + let beginningIndex = subranges._partitioningIndex { + if includeAdjacent { + $0.upperBound >= range.lowerBound + } else { + $0.upperBound > range.lowerBound + } + } + + // The ending index for `range` is the first range with a lower bound + // greater than `range`'s upper bound. If this is the same as + // `beginningIndex`, than `range` doesn't overlap any of the existing + // ranges. If this is `ranges.endIndex`, then `range` overlaps the + // rest of the ranges. Otherwise, `range` overlaps one or + // more ranges in the set. + let endingIndex = subranges[beginningIndex...]._partitioningIndex { + if includeAdjacent { + $0.lowerBound > range.upperBound + } else { + $0.lowerBound >= range.upperBound + } + } + + return beginningIndex ..< endingIndex + } - // Insert a non-empty range into the storage - internal mutating func _insert(contentsOf range: Range) { - let indices = _indicesOfRange(range, in: _storage) - if indices.isEmpty { - _storage.insert(range, at: indices.lowerBound) - } else { - let lower = Swift.min( - _storage[indices.lowerBound].lowerBound, range.lowerBound) - let upper = Swift.max( - _storage[indices.upperBound - 1].upperBound, range.upperBound) - _storage.replaceSubrange( - indices, with: CollectionOfOne(lower ..< upper)) - } - } + // Insert a non-empty range into the storage + internal mutating func _insert(contentsOf range: Range) { + let indices = _indicesOfRange(range, in: _storage) + if indices.isEmpty { + _storage.insert(range, at: indices.lowerBound) + } else { + let lower = Swift.min( + _storage[indices.lowerBound].lowerBound, range.lowerBound) + let upper = Swift.max( + _storage[indices.upperBound - 1].upperBound, range.upperBound) + _storage.replaceSubrange( + indices, with: CollectionOfOne(lower ..< upper)) + } + } - // Remove a non-empty range from the storage - internal mutating func _remove(contentsOf range: Range) { - let indices = _indicesOfRange(range, in: _storage, includeAdjacent: false) - guard !indices.isEmpty else { - return - } - - let overlapsLowerBound = - range.lowerBound > _storage[indices.lowerBound].lowerBound - let overlapsUpperBound = - range.upperBound < _storage[indices.upperBound - 1].upperBound + // Remove a non-empty range from the storage + internal mutating func _remove(contentsOf range: Range) { + let indices = _indicesOfRange(range, in: _storage, includeAdjacent: false) + guard !indices.isEmpty else { + return + } + + let overlapsLowerBound = + range.lowerBound > _storage[indices.lowerBound].lowerBound + let overlapsUpperBound = + range.upperBound < _storage[indices.upperBound - 1].upperBound - switch (overlapsLowerBound, overlapsUpperBound) { - case (false, false): - _storage.removeSubrange(indices) - case (false, true): - let newRange = - range.upperBound..<_storage[indices.upperBound - 1].upperBound - _storage.replaceSubrange(indices, with: CollectionOfOne(newRange)) - case (true, false): - let newRange = - _storage[indices.lowerBound].lowerBound ..< range.lowerBound - _storage.replaceSubrange(indices, with: CollectionOfOne(newRange)) - case (true, true): - _storage.replaceSubrange(indices, with: _Pair( - _storage[indices.lowerBound].lowerBound..) -> Self { - let indices = _indicesOfRange(bounds, in: _storage) - guard !indices.isEmpty else { - return Self(_range: bounds) - } - - var result: [Range] = [] - var low = bounds.lowerBound - for range in _storage[indices] { - let gapRange = low ..< range.lowerBound - if !gapRange.isEmpty { - result.append(gapRange) - } - low = range.upperBound - } - let finalRange = low ..< bounds.upperBound - if !finalRange.isEmpty { - result.append(finalRange) - } - let resultVal = Self(_ranges: result) - return resultVal - } + /// Returns a that represents the ranges of values within the + /// given bounds that aren't represented by this range set. + internal func _gaps(boundedBy bounds: Range) -> Self { + let indices = _indicesOfRange(bounds, in: _storage) + guard !indices.isEmpty else { + return Self(_range: bounds) + } + + var result: [Range] = [] + var low = bounds.lowerBound + for range in _storage[indices] { + let gapRange = low ..< range.lowerBound + if !gapRange.isEmpty { + result.append(gapRange) + } + low = range.upperBound + } + let finalRange = low ..< bounds.upperBound + if !finalRange.isEmpty { + result.append(finalRange) + } + let resultVal = Self(_ranges: result) + return resultVal + } - internal func _intersection(_ other: Ranges) -> Ranges { - let left = self._storage - let right = other._storage - var otherRangeIndex = 0 - var result: [Range] = [] - - // Considering these two range sets: - // - // self = [0..<5, 9..<14] - // other = [1..<3, 4..<6, 8..<12] - // - // `self.intersection(other)` looks like this, where x's cover the - // ranges in `self`, y's cover the ranges in `other`, and z's cover the - // resulting ranges: - // - // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 - // xxxxxxxxxxxxxxxxxxx__ xxxxxxxxxxxxxxxxxxx__ - // yyyyyyy__ yyyyyyy__ yyyyyyyyyyyyyyy__ - // zzzzzzz__ zzz__ zzzzzzzzzzz__ - // - // The same, but for `other.intersection(self)`: - // - // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 - // xxxxxxx__ xxxxxxx__ xxxxxxxxxxxxxxx__ - // yyyyyyyyyyyyyyyyyyy__ yyyyyyyyyyyyyyyyyyy__ - // zzzzzzz__ zzz__ zzzzzzzzzzz__ - - for currentRange in left { - // Search forward in `right` until finding either an overlapping - // range or one that is strictly higher than this range. - while otherRangeIndex < right.endIndex && - right[otherRangeIndex].upperBound <= currentRange.lowerBound - { - otherRangeIndex += 1 - } - - // For each range in `right` that overlaps with the current range - // in `left`, append the intersection to the result. - while otherRangeIndex < right.endIndex && - right[otherRangeIndex].lowerBound < currentRange.upperBound - { - let overlap = right[otherRangeIndex].clamped(to: currentRange) - result.append(overlap) - - // If the range in `right` continues past the current range in - // `self`, it could overlap the next range in `self`, so break - // out of examining the current range. - guard - currentRange.upperBound > right[otherRangeIndex].upperBound - else { - break - } - otherRangeIndex += 1 - } - } - - return Ranges(_ranges: result) - } + internal func _intersection(_ other: Self) -> Self { + let left = self._storage + let right = other._storage + var otherRangeIndex = 0 + var result: [Range] = [] + + // Considering these two range sets: + // + // self = [0..<5, 9..<14] + // other = [1..<3, 4..<6, 8..<12] + // + // `self.intersection(other)` looks like this, where x's cover the + // ranges in `self`, y's cover the ranges in `other`, and z's cover the + // resulting ranges: + // + // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 + // xxxxxxxxxxxxxxxxxxx__ xxxxxxxxxxxxxxxxxxx__ + // yyyyyyy__ yyyyyyy__ yyyyyyyyyyyyyyy__ + // zzzzzzz__ zzz__ zzzzzzzzzzz__ + // + // The same, but for `other.intersection(self)`: + // + // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 + // xxxxxxx__ xxxxxxx__ xxxxxxxxxxxxxxx__ + // yyyyyyyyyyyyyyyyyyy__ yyyyyyyyyyyyyyyyyyy__ + // zzzzzzz__ zzz__ zzzzzzzzzzz__ + + for currentRange in left { + // Search forward in `right` until finding either an overlapping + // range or one that is strictly higher than this range. + while otherRangeIndex < right.endIndex && + right[otherRangeIndex].upperBound <= currentRange.lowerBound + { + otherRangeIndex += 1 + } + + // For each range in `right` that overlaps with the current range + // in `left`, append the intersection to the result. + while otherRangeIndex < right.endIndex && + right[otherRangeIndex].lowerBound < currentRange.upperBound + { + let overlap = right[otherRangeIndex].clamped(to: currentRange) + result.append(overlap) + + // If the range in `right` continues past the current range in + // `self`, it could overlap the next range in `self`, so break + // out of examining the current range. + guard + currentRange.upperBound > right[otherRangeIndex].upperBound + else { + break + } + otherRangeIndex += 1 + } + } + + return Self(_ranges: result) } } @available(SwiftStdlib 5.11, *) -extension RangeSet.Ranges : Sequence { +extension RangeSet.Ranges: Sequence { public typealias Element = Range public typealias Iterator = IndexingIterator } @available(SwiftStdlib 5.11, *) -extension RangeSet.Ranges : Collection { +extension RangeSet.Ranges: Collection { public typealias Index = Int public typealias Indices = Range public typealias SubSequence = Slice @@ -252,20 +255,20 @@ extension RangeSet.Ranges : Collection { } @available(SwiftStdlib 5.11, *) -extension RangeSet.Ranges : RandomAccessCollection {} +extension RangeSet.Ranges: RandomAccessCollection {} @available(SwiftStdlib 5.11, *) extension RangeSet.Ranges: Equatable { public static func == (left: Self, right: Self) -> Bool { - left._storage == right._storage + left._storage == right._storage } } @available(SwiftStdlib 5.11, *) extension RangeSet.Ranges: Hashable where Bound: Hashable { public func hash(into hasher: inout Hasher) { - hasher.combine(_storage.count) // Discriminator - hasher.combine(_storage) + hasher.combine(_storage.count) // Discriminator + hasher.combine(_storage) } } diff --git a/validation-test/stdlib/RangeSet.swift b/validation-test/stdlib/RangeSet.swift index cce9c39645167..8c74f624fa05b 100644 --- a/validation-test/stdlib/RangeSet.swift +++ b/validation-test/stdlib/RangeSet.swift @@ -278,6 +278,39 @@ if #available(SwiftStdlib 5.11, *) { } } + RangeSetTests.test("isSubset") { + func isSubsetViaSet(_ s1: RangeSet, _ s2: RangeSet) -> Bool { + let set1 = Set(parent.indices[s1]) + let set2 = Set(parent.indices[s2]) + return set1.isSubset(of: set2) + } + + do { + // Simple test + let set1: RangeSet = [0..<5, 9..<14] + let set2: RangeSet = [1..<3, 4..<6, 8..<12] + let set3: RangeSet = [6..<9, 14..<20] + let set4: RangeSet = [1..<2, 10..<12] + expectFalse(set1.isSubset(of: set2)) + expectFalse(set2.isSubset(of: set1)) + expectFalse(set1.isSubset(of: set3)) + expectFalse(set3.isSubset(of: set1)) + expectFalse(set1.isSubset(of: set4)) + expectFalse(set2.isSubset(of: set4)) + expectTrue(set4.isSubset(of: set1)) + expectTrue(set4.isSubset(of: set2)) + } + + for _ in 0..<100 { + let set1 = buildRandomRangeSet() + let set2 = buildRandomRangeSet() + + let rangeSetSubset = set1.isSubset(of: set2) + let stdlibSetSubset = isSubsetViaSet(set1, set2) + expectEqual(rangeSetSubset, stdlibSetSubset) + } + } + RangeSetTests.test("indices(of:/where:)") { let a = [1, 2, 3, 4, 3, 3, 4, 5, 3, 4, 3, 3, 3] let indices = a.indices(of: 3) From c5d5b0a0d82dbac1ebd466793aa192773ae3dcdc Mon Sep 17 00:00:00 2001 From: Jeremy Schonfeld Date: Tue, 5 Dec 2023 12:01:03 -0500 Subject: [PATCH 11/17] Add test for underscored, public slice members --- validation-test/stdlib/RangeSet.swift | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/validation-test/stdlib/RangeSet.swift b/validation-test/stdlib/RangeSet.swift index 8c74f624fa05b..1cdfae8b52a6e 100644 --- a/validation-test/stdlib/RangeSet.swift +++ b/validation-test/stdlib/RangeSet.swift @@ -418,6 +418,30 @@ if #available(SwiftStdlib 5.11, *) { } } + RangeSetTests.test("DiscontiguousSliceSequence") { + let initial = 1...100 + + // Build an array of ranges that include alternating groups of 5 elements + // e.g. 1...5, 11...15, etc + let rangeStarts = initial.indices.every(10) + let rangeEnds = rangeStarts.compactMap { + initial.index($0, offsetBy: 5, limitedBy: initial.endIndex) + } + let ranges = zip(rangeStarts, rangeEnds).map(Range.init) + let set = RangeSet(ranges) + let slice = initial[set] + + // Test various public, underscored members for the slice's + // Sequence/Collection conformance + expectTrue(slice.contains(2)) + expectFalse(slice.contains(7)) + expectEqualSequence(Array(slice), slice) + expectEqual(slice.firstIndex(of: 2), slice.index(after: slice.startIndex)) + expectEqual(slice.firstIndex(of: 7), nil) + expectEqual(slice.lastIndex(of: 2), slice.index(after: slice.startIndex)) + expectEqual(slice.lastIndex(of: 7), nil) + } + RangeSetTests.test("DiscontiguousSliceSlicing") { let initial = 1...100 From e16312114520d1006dd790161195afaf9017bb3f Mon Sep 17 00:00:00 2001 From: Jeremy Schonfeld Date: Fri, 15 Dec 2023 12:24:49 -0800 Subject: [PATCH 12/17] Address feedback on inlining, hashing, and initializing with unordered arrays --- stdlib/public/core/CollectionAlgorithms.swift | 1 + stdlib/public/core/DiscontiguousSlice.swift | 2 + .../core/RangeReplaceableCollection.swift | 2 + stdlib/public/core/RangeSet.swift | 20 ++++++--- stdlib/public/core/RangeSetRanges.swift | 43 +++++++++++++++++-- 5 files changed, 59 insertions(+), 9 deletions(-) diff --git a/stdlib/public/core/CollectionAlgorithms.swift b/stdlib/public/core/CollectionAlgorithms.swift index 98a36d36e4d9e..e9e215477aa75 100644 --- a/stdlib/public/core/CollectionAlgorithms.swift +++ b/stdlib/public/core/CollectionAlgorithms.swift @@ -233,6 +233,7 @@ extension Collection { /// /// - Complexity: O(*n*), where *n* is the length of the collection. @available(SwiftStdlib 5.11, *) + @inlinable public func indices( where predicate: (Element) throws -> Bool ) rethrows -> RangeSet { diff --git a/stdlib/public/core/DiscontiguousSlice.swift b/stdlib/public/core/DiscontiguousSlice.swift index 5d700b1d4610c..05b085855e7e4 100644 --- a/stdlib/public/core/DiscontiguousSlice.swift +++ b/stdlib/public/core/DiscontiguousSlice.swift @@ -24,6 +24,7 @@ public struct DiscontiguousSlice { return _base } + @usableFromInline internal init(_base: Base, subranges: RangeSet) { self._base = _base self.subranges = subranges @@ -198,6 +199,7 @@ extension DiscontiguousSlice: Collection { return DiscontiguousSlice(_base: base, subranges: subset) } + @usableFromInline internal func _index(of baseIndex: Base.Index) -> Index? { let rangeOffset = subranges.ranges ._partitioningIndex { $0.upperBound >= baseIndex } diff --git a/stdlib/public/core/RangeReplaceableCollection.swift b/stdlib/public/core/RangeReplaceableCollection.swift index 8ca6e9e36e25f..b8bf73ced5951 100644 --- a/stdlib/public/core/RangeReplaceableCollection.swift +++ b/stdlib/public/core/RangeReplaceableCollection.swift @@ -1194,6 +1194,7 @@ extension RangeReplaceableCollection { /// /// - Complexity: O(*n*), where *n* is the length of the collection. @available(SwiftStdlib 5.11, *) + @inlinable public mutating func removeSubranges(_ subranges: RangeSet) { guard !subranges.isEmpty else { return @@ -1224,6 +1225,7 @@ extension MutableCollection where Self: RangeReplaceableCollection { /// /// - Complexity: O(*n*), where *n* is the length of the collection. @available(SwiftStdlib 5.11, *) + @inlinable public mutating func removeSubranges(_ subranges: RangeSet) { guard let firstRange = subranges.ranges.first else { return diff --git a/stdlib/public/core/RangeSet.swift b/stdlib/public/core/RangeSet.swift index 8ad6d1d624b47..05d73a739e643 100644 --- a/stdlib/public/core/RangeSet.swift +++ b/stdlib/public/core/RangeSet.swift @@ -28,6 +28,7 @@ /// // numbers == [-5, -3, -9, 10, 12, 14, 15] @available(SwiftStdlib 5.11, *) public struct RangeSet { + @usableFromInline internal var _ranges: Ranges /// A collection of the ranges that make up the range set. @@ -63,12 +64,14 @@ public struct RangeSet { /// /// - Parameter ranges: The ranges to use for the new range set. public init(_ ranges: some Sequence>) { - self.init() - for range in ranges { - insert(contentsOf: range) + if let ranges = _specialize(ranges, for: Ranges.self) { + self.init(_ranges: ranges) + return } + self.init(_ranges: Ranges(_unorderedRanges: Array(ranges))) } + @usableFromInline internal init(_ranges: Ranges) { self._ranges = _ranges } @@ -80,17 +83,21 @@ public struct RangeSet { /// or upper bounds. In addition to not overlapping, no two consecutive /// ranges share an upper and lower bound — `[0..<5, 5..<10]` is ill-formed, /// and would instead be represented as `[0..<10]`. + @usableFromInline internal func _checkInvariants() { +#if INTERNAL_CHECKS_ENABLED for (a, b) in zip(_ranges, _ranges.dropFirst()) { - _debugPrecondition(!a.isEmpty && !b.isEmpty, "Empty range in range set") - _debugPrecondition( + _precondition(!a.isEmpty && !b.isEmpty, "Empty range in range set") + _precondition( a.upperBound < b.lowerBound, "Out of order/overlapping ranges in range set") } +#endif } /// Creates a new range set from `ranges`, which satisfies the range set /// invariants. + @usableFromInline internal init(_orderedRanges ranges: [Range]) { switch ranges.count { case 0: self._ranges = Ranges() @@ -124,6 +131,7 @@ public struct RangeSet { /// /// - Complexity: O(*n*), where *n* is the number of ranges in the range /// set. + @inlinable public mutating func insert(contentsOf range: Range) { if range.isEmpty { return } _ranges._insert(contentsOf: range) @@ -169,6 +177,7 @@ extension RangeSet { /// - index: The index to include in the range set. `index` must be a /// valid index of `collection` that isn't the collection's `endIndex`. /// - collection: The collection that contains `index`. + @inlinable public init( _ indices: S, within collection: C ) where S.Element == C.Index, C.Index == Bound { @@ -220,6 +229,7 @@ extension RangeSet { /// /// - Complexity: O(*n*), where *n* is the number of ranges in the range /// set. + @usableFromInline internal func _inverted( within collection: C ) -> RangeSet where C: Collection, C.Index == Bound { diff --git a/stdlib/public/core/RangeSetRanges.swift b/stdlib/public/core/RangeSetRanges.swift index ec130e9df7ef5..ceff04843c5db 100644 --- a/stdlib/public/core/RangeSetRanges.swift +++ b/stdlib/public/core/RangeSetRanges.swift @@ -14,24 +14,55 @@ extension RangeSet { /// A collection of the ranges that make up a range set. public struct Ranges { - internal var _storage: [Range] + internal var _storage: ContiguousArray> + @usableFromInline internal init() { _storage = [] } + @usableFromInline internal init(_range: Range) { _storage = [_range] } + @usableFromInline internal init(_ranges: [Range]) { - _storage = _ranges + _storage = ContiguousArray(_ranges) + } + + @usableFromInline + internal init(_unorderedRanges: [Range]) { + _storage = ContiguousArray(_unorderedRanges) + _storage.sort { + $0.lowerBound < $1.lowerBound + } + var i = 0 + while i < _storage.count { + let current = _storage[i] + if i > 0 { + let previous = _storage[i - 1] + if previous.upperBound >= current.lowerBound { + let newUpper = Swift.max(previous.upperBound, current.upperBound) + _storage[i - 1] = previous.lowerBound ..< newUpper + _storage.remove(at: i) + continue + } + } + + if current.isEmpty { + _storage.remove(at: i) + } else { + i += 1 + } + } } } } @available(SwiftStdlib 5.11, *) extension RangeSet.Ranges { + @usableFromInline internal func _contains(_ bound: Bound) -> Bool { let i = _storage._partitioningIndex { $0.upperBound > bound } return i == _storage.endIndex ? false : _storage[i].lowerBound <= bound @@ -46,9 +77,10 @@ extension RangeSet.Ranges { /// - `_indicesOfRange(12..<19) == 1..<2` /// - `_indicesOfRange(17..<19) == 2..<2` /// - `_indicesOfRange(12..<22) == 1..<3` + @usableFromInline internal func _indicesOfRange( _ range: Range, - in subranges: [Range], + in subranges: ContiguousArray>, includeAdjacent: Bool = true ) -> Range { guard subranges.count > 1 else { @@ -95,6 +127,7 @@ extension RangeSet.Ranges { } // Insert a non-empty range into the storage + @usableFromInline internal mutating func _insert(contentsOf range: Range) { let indices = _indicesOfRange(range, in: _storage) if indices.isEmpty { @@ -110,6 +143,7 @@ extension RangeSet.Ranges { } // Remove a non-empty range from the storage + @usableFromInline internal mutating func _remove(contentsOf range: Range) { let indices = _indicesOfRange(range, in: _storage, includeAdjacent: false) guard !indices.isEmpty else { @@ -142,6 +176,7 @@ extension RangeSet.Ranges { /// Returns a that represents the ranges of values within the /// given bounds that aren't represented by this range set. + @usableFromInline internal func _gaps(boundedBy bounds: Range) -> Self { let indices = _indicesOfRange(bounds, in: _storage) guard !indices.isEmpty else { @@ -165,6 +200,7 @@ extension RangeSet.Ranges { return resultVal } + @usableFromInline internal func _intersection(_ other: Self) -> Self { let left = self._storage let right = other._storage @@ -267,7 +303,6 @@ extension RangeSet.Ranges: Equatable { @available(SwiftStdlib 5.11, *) extension RangeSet.Ranges: Hashable where Bound: Hashable { public func hash(into hasher: inout Hasher) { - hasher.combine(_storage.count) // Discriminator hasher.combine(_storage) } } From f8ae5777e51d1d2cec54cb743af872f248cc7f8f Mon Sep 17 00:00:00 2001 From: Jeremy Schonfeld Date: Mon, 18 Dec 2023 10:54:49 -0800 Subject: [PATCH 13/17] Fix ABI checker issues --- test/abi/macOS/arm64/stdlib.swift | 187 +++++++++++++++++++++++++++++ test/abi/macOS/x86_64/stdlib.swift | 187 +++++++++++++++++++++++++++++ 2 files changed, 374 insertions(+) diff --git a/test/abi/macOS/arm64/stdlib.swift b/test/abi/macOS/arm64/stdlib.swift index 4d56470f092f8..6f3d0ef02645d 100644 --- a/test/abi/macOS/arm64/stdlib.swift +++ b/test/abi/macOS/arm64/stdlib.swift @@ -64,4 +64,191 @@ Added: _$ss20__StaticArrayStorageCfd Added: _OBJC_CLASS_$__TtCs20__StaticArrayStorage Added: _OBJC_METACLASS_$__TtCs20__StaticArrayStorage +// struct DiscontiguousSlice +Added: _$ss18DiscontiguousSliceV10startIndexAB0D0Vyx_Gvg +Added: _$ss18DiscontiguousSliceV10startIndexAB0D0Vyx_GvpMV +Added: _$ss18DiscontiguousSliceV11descriptionSSvg +Added: _$ss18DiscontiguousSliceV11descriptionSSvpMV +Added: _$ss18DiscontiguousSliceV20_failEarlyRangeCheck_6boundsyAB5IndexVyx_G_SNyAGGtF +Added: _$ss18DiscontiguousSliceV20_failEarlyRangeCheck_6boundsyAB5IndexVyx_G_SnyAGGtF +Added: _$ss18DiscontiguousSliceV20_failEarlyRangeCheck_6boundsySnyAB5IndexVyx_GG_AHtF +Added: _$ss18DiscontiguousSliceV22_copyToContiguousArrays0eF0Vy7ElementQzGyF +Added: _$ss18DiscontiguousSliceV30_customIndexOfEquatableElementyAB0D0Vyx_GSgSg0G0QzF +Added: _$ss18DiscontiguousSliceV31_customContainsEquatableElementySbSg0F0QzF +Added: _$ss18DiscontiguousSliceV34_customLastIndexOfEquatableElementyAB0E0Vyx_GSgSg0H0QzF +Added: _$ss18DiscontiguousSliceV4basexvg +Added: _$ss18DiscontiguousSliceV4basexvpMV +Added: _$ss18DiscontiguousSliceV5IndexV11descriptionSSvg +Added: _$ss18DiscontiguousSliceV5IndexV11descriptionSSvpMV +Added: _$ss18DiscontiguousSliceV5IndexV1loiySbADyx_G_AFtFZ +Added: _$ss18DiscontiguousSliceV5IndexV2eeoiySbADyx_G_AFtFZ +Added: _$ss18DiscontiguousSliceV5IndexV4baseACQzvg +Added: _$ss18DiscontiguousSliceV5IndexV4baseACQzvpMV +Added: _$ss18DiscontiguousSliceV5IndexVMa +Added: _$ss18DiscontiguousSliceV5IndexVMn +Added: _$ss18DiscontiguousSliceV5IndexVsSHACRpzrlE4hash4intoys6HasherVz_tF +Added: _$ss18DiscontiguousSliceV5IndexVsSHACRpzrlE9hashValueSivg +Added: _$ss18DiscontiguousSliceV5IndexVsSHACRpzrlE9hashValueSivpMV +Added: _$ss18DiscontiguousSliceV5IndexVyx_GSHsSHACRpzrlMc +Added: _$ss18DiscontiguousSliceV5IndexVyx_GSLsMc +Added: _$ss18DiscontiguousSliceV5IndexVyx_GSLsWP +Added: _$ss18DiscontiguousSliceV5IndexVyx_GSQsMc +Added: _$ss18DiscontiguousSliceV5IndexVyx_GSQsWP +Added: _$ss18DiscontiguousSliceV5IndexVyx_Gs23CustomStringConvertiblesMc +Added: _$ss18DiscontiguousSliceV5IndexVyx_Gs23CustomStringConvertiblesWP +Added: _$ss18DiscontiguousSliceV5_base9subrangesAByxGx_s8RangeSetVy5IndexQzGtcfC +Added: _$ss18DiscontiguousSliceV5countSivg +Added: _$ss18DiscontiguousSliceV5countSivpMV +Added: _$ss18DiscontiguousSliceV5index5afterAB5IndexVyx_GAG_tF +Added: _$ss18DiscontiguousSliceV6_index2ofAB5IndexVyx_GSgAEQz_tF +Added: _$ss18DiscontiguousSliceV7isEmptySbvg +Added: _$ss18DiscontiguousSliceV7isEmptySbvpMV +Added: _$ss18DiscontiguousSliceV8distance4from2toSiAB5IndexVyx_G_AHtF +Added: _$ss18DiscontiguousSliceV8endIndexAB0D0Vyx_Gvg +Added: _$ss18DiscontiguousSliceV8endIndexAB0D0Vyx_GvpMV +Added: _$ss18DiscontiguousSliceV9subrangess8RangeSetVy5IndexQzGvg +Added: _$ss18DiscontiguousSliceV9subrangess8RangeSetVy5IndexQzGvpMV +Added: _$ss18DiscontiguousSliceVMa +Added: _$ss18DiscontiguousSliceVMn +Added: _$ss18DiscontiguousSliceVsSH7ElementRpzrlE4hash4intoys6HasherVz_tF +Added: _$ss18DiscontiguousSliceVsSH7ElementRpzrlE9hashValueSivg +Added: _$ss18DiscontiguousSliceVsSH7ElementRpzrlE9hashValueSivpMV +Added: _$ss18DiscontiguousSliceVsSKRzrlE5index6beforeAB5IndexVyx_GAG_tF +Added: _$ss18DiscontiguousSliceVsSMRzrlEy7ElementQzAB5IndexVyx_GciM +Added: _$ss18DiscontiguousSliceVsSMRzrlEy7ElementQzAB5IndexVyx_Gcig +Added: _$ss18DiscontiguousSliceVsSMRzrlEy7ElementQzAB5IndexVyx_GcipMV +Added: _$ss18DiscontiguousSliceVsSMRzrlEy7ElementQzAB5IndexVyx_Gcis +Added: _$ss18DiscontiguousSliceVsSQ7ElementRpzrlE2eeoiySbAByxG_AFtFZ +Added: _$ss18DiscontiguousSliceVy7ElementQzAB5IndexVyx_Gcig +Added: _$ss18DiscontiguousSliceVy7ElementQzAB5IndexVyx_GcipMV +Added: _$ss18DiscontiguousSliceVyAByxGSnyAB5IndexVyx_GGcig +Added: _$ss18DiscontiguousSliceVyAByxGSnyAB5IndexVyx_GGcipMV +Added: _$ss18DiscontiguousSliceVyxGSHsSH7ElementRpzrlMc +Added: _$ss18DiscontiguousSliceVyxGSKsSKRzrlMc +Added: _$ss18DiscontiguousSliceVyxGSQsSQ7ElementRpzrlMc +Added: _$ss18DiscontiguousSliceVyxGSTsMc +Added: _$ss18DiscontiguousSliceVyxGSlsMc +Added: _$ss18DiscontiguousSliceVyxGs23CustomStringConvertiblesMc +Added: _$ss18DiscontiguousSliceVyxGs23CustomStringConvertiblesWP + +// (extension in Swift):Swift.MutableCollection.subscript.modify : (Swift.RangeSet) -> Swift.DiscontiguousSlice +Added: _$sSMsEys18DiscontiguousSliceVyxGs8RangeSetVy5IndexQzGciM + +// (extension in Swift):Swift.MutableCollection.subscript.getter : (Swift.RangeSet) -> Swift.DiscontiguousSlice +Added: _$sSMsEys18DiscontiguousSliceVyxGs8RangeSetVy5IndexQzGcig + +// property descriptor for (extension in Swift):Swift.MutableCollection.subscript(Swift.RangeSet) -> Swift.DiscontiguousSlice +Added: _$sSMsEys18DiscontiguousSliceVyxGs8RangeSetVy5IndexQzGcipMV + +// (extension in Swift):Swift.MutableCollection.subscript.setter : (Swift.RangeSet) -> Swift.DiscontiguousSlice +Added: _$sSMsEys18DiscontiguousSliceVyxGs8RangeSetVy5IndexQzGcis + +// (extension in Swift):Swift.Collection.removingSubranges(Swift.RangeSet) -> Swift.DiscontiguousSlice +Added: _$sSlsE17removingSubrangesys18DiscontiguousSliceVyxGs8RangeSetVy5IndexQzGF + +// (extension in Swift):Swift.Collection.subscript.getter : (Swift.RangeSet) -> Swift.DiscontiguousSlice +Added: _$sSlsEys18DiscontiguousSliceVyxGs8RangeSetVy5IndexQzGcig + +// property descriptor for (extension in Swift):Swift.Collection.subscript(Swift.RangeSet) -> Swift.DiscontiguousSlice +Added: _$sSlsEys18DiscontiguousSliceVyxGs8RangeSetVy5IndexQzGcipMV + +// struct RangeSet +Added: _$ss8RangeSetV10isDisjointySbAByxGF +Added: _$ss8RangeSetV10isSuperset2ofSbAByxG_tF +Added: _$ss8RangeSetV11descriptionSSvg +Added: _$ss8RangeSetV11descriptionSSvpMV +Added: _$ss8RangeSetV11subtractingyAByxGADF +Added: _$ss8RangeSetV12intersectionyAByxGADF +Added: _$ss8RangeSetV14_orderedRangesAByxGSaySnyxGG_tcfC +Added: _$ss8RangeSetV14isStrictSubset2ofSbAByxG_tF +Added: _$ss8RangeSetV16_checkInvariantsyyF +Added: _$ss8RangeSetV16formIntersectionyyAByxGF +Added: _$ss8RangeSetV16isStrictSuperset2ofSbAByxG_tF +Added: _$ss8RangeSetV19symmetricDifferenceyAByxGADnF +Added: _$ss8RangeSetV23formSymmetricDifferenceyyAByxGnF +Added: _$ss8RangeSetV2eeoiySbAByxG_ADtFZ +Added: _$ss8RangeSetV5unionyAByxGADnF +Added: _$ss8RangeSetV6RangesV010_indicesOfA0_2in15includeAdjacentSnySiGSnyxG_s15ContiguousArrayVyAIGSbtF +Added: _$ss8RangeSetV6RangesV010_unorderedC0ADyx_GSaySnyxGG_tcfC +Added: _$ss8RangeSetV6RangesV10startIndexSivg +Added: _$ss8RangeSetV6RangesV10startIndexSivpMV +Added: _$ss8RangeSetV6RangesV11descriptionSSvg +Added: _$ss8RangeSetV6RangesV11descriptionSSvpMV +Added: _$ss8RangeSetV6RangesV13_intersectionyADyx_GAFF +Added: _$ss8RangeSetV6RangesV2eeoiySbADyx_G_AFtFZ +Added: _$ss8RangeSetV6RangesV5_gaps9boundedByADyx_GSnyxG_tF +Added: _$ss8RangeSetV6RangesV5countSivg +Added: _$ss8RangeSetV6RangesV5countSivpMV +Added: _$ss8RangeSetV6RangesV6_rangeADyx_GSnyxG_tcfC +Added: _$ss8RangeSetV6RangesV7_insert10contentsOfySnyxG_tF +Added: _$ss8RangeSetV6RangesV7_rangesADyx_GSaySnyxGG_tcfC +Added: _$ss8RangeSetV6RangesV7_remove10contentsOfySnyxG_tF +Added: _$ss8RangeSetV6RangesV8endIndexSivg +Added: _$ss8RangeSetV6RangesV8endIndexSivpMV +Added: _$ss8RangeSetV6RangesV9_containsySbxF +Added: _$ss8RangeSetV6RangesVADyx_GycfC +Added: _$ss8RangeSetV6RangesVMa +Added: _$ss8RangeSetV6RangesVMn +Added: _$ss8RangeSetV6RangesVsSHRzrlE4hash4intoys6HasherVz_tF +Added: _$ss8RangeSetV6RangesVsSHRzrlE9hashValueSivg +Added: _$ss8RangeSetV6RangesVsSHRzrlE9hashValueSivpMV +Added: _$ss8RangeSetV6RangesVySnyxGSicig +Added: _$ss8RangeSetV6RangesVySnyxGSicipMV +Added: _$ss8RangeSetV6RangesVyx_GSHsSHRzrlMc +Added: _$ss8RangeSetV6RangesVyx_GSKsMc +Added: _$ss8RangeSetV6RangesVyx_GSQsMc +Added: _$ss8RangeSetV6RangesVyx_GSQsWP +Added: _$ss8RangeSetV6RangesVyx_GSTsMc +Added: _$ss8RangeSetV6RangesVyx_GSksMc +Added: _$ss8RangeSetV6RangesVyx_GSlsMc +Added: _$ss8RangeSetV6RangesVyx_Gs23CustomStringConvertiblesMc +Added: _$ss8RangeSetV6RangesVyx_Gs23CustomStringConvertiblesWP +Added: _$ss8RangeSetV6insert10contentsOfySnyxG_tF +Added: _$ss8RangeSetV6insert_6withinyx_qd__t5IndexQyd__RszSlRd__lF +Added: _$ss8RangeSetV6rangesAB6RangesVyx_Gvg +Added: _$ss8RangeSetV6rangesAB6RangesVyx_GvpMV +Added: _$ss8RangeSetV6remove10contentsOfySnyxG_tF +Added: _$ss8RangeSetV6remove_6withinyx_qd__t5IndexQyd__RszSlRd__lF +Added: _$ss8RangeSetV7_rangesAB6RangesVyx_GvM +Added: _$ss8RangeSetV7_rangesAB6RangesVyx_Gvg +Added: _$ss8RangeSetV7_rangesAB6RangesVyx_GvpMV +Added: _$ss8RangeSetV7_rangesAB6RangesVyx_Gvs +Added: _$ss8RangeSetV7_rangesAByxGAB6RangesVyx_G_tcfC +Added: _$ss8RangeSetV7isEmptySbvg +Added: _$ss8RangeSetV7isEmptySbvpMV +Added: _$ss8RangeSetV8containsySbxF +Added: _$ss8RangeSetV8isSubset2ofSbAByxG_tF +Added: _$ss8RangeSetV8subtractyyAByxGF +Added: _$ss8RangeSetV9_inverted6withinAByxGqd___t5IndexQyd__RszSlRd__lF +Added: _$ss8RangeSetV9formUnionyyAByxGnF +Added: _$ss8RangeSetVAByxGycfC +Added: _$ss8RangeSetVMa +Added: _$ss8RangeSetVMn +Added: _$ss8RangeSetV_6withinAByxGqd___qd_0_tc7ElementQyd__RszSTRd__SlRd_0_5IndexQyd_0_AFRSr0_lufC +Added: _$ss8RangeSetVsSHRzrlE4hash4intoys6HasherVz_tF +Added: _$ss8RangeSetVsSHRzrlE9hashValueSivg +Added: _$ss8RangeSetVsSHRzrlE9hashValueSivpMV +Added: _$ss8RangeSetVyAByxGSnyxGcfC +Added: _$ss8RangeSetVyAByxGqd__cSTRd__SnyxG7ElementRtd__lufC +Added: _$ss8RangeSetVyxGSHsSHRzrlMc +Added: _$ss8RangeSetVyxGSQsMc +Added: _$ss8RangeSetVyxGSQsWP +Added: _$ss8RangeSetVyxGs23CustomStringConvertiblesMc +Added: _$ss8RangeSetVyxGs23CustomStringConvertiblesWP + +// (extension in Swift):Swift.Collection< where A.Element: Swift.Equatable>.indices(of: A.Element) -> Swift.RangeSet +Added: _$sSlsSQ7ElementRpzrlE7indices2ofs8RangeSetVy5IndexQzGAB_tF + +// (extension in Swift):Swift.RangeReplaceableCollection.removeSubranges(Swift.RangeSet) -> () +Added: _$sSmsE15removeSubrangesyys8RangeSetVy5IndexQzGF + +// (extension in Swift):Swift.Collection.indices(where: (A.Element) throws -> Swift.Bool) throws -> Swift.RangeSet +Added: _$sSlsE7indices5wheres8RangeSetVy5IndexQzGSb7ElementQzKXE_tKF + +// (extension in Swift):Swift.MutableCollection< where A: Swift.RangeReplaceableCollection>.removeSubranges(Swift.RangeSet) -> () +Added: _$sSMsSmRzrlE15removeSubrangesyys8RangeSetVy5IndexSlQzGF + +// (extension in Swift):Swift.MutableCollection.moveSubranges(_: Swift.RangeSet, to: A.Index) -> Swift.Range +Added: _$sSMsE13moveSubranges_2toSny5IndexQzGs8RangeSetVyADG_ADtF + // Runtime Symbols diff --git a/test/abi/macOS/x86_64/stdlib.swift b/test/abi/macOS/x86_64/stdlib.swift index 71127971381dc..948a24e132a13 100644 --- a/test/abi/macOS/x86_64/stdlib.swift +++ b/test/abi/macOS/x86_64/stdlib.swift @@ -64,4 +64,191 @@ Added: _$ss20__StaticArrayStorageCfd Added: _OBJC_CLASS_$__TtCs20__StaticArrayStorage Added: _OBJC_METACLASS_$__TtCs20__StaticArrayStorage +// struct DiscontiguousSlice +Added: _$ss18DiscontiguousSliceV10startIndexAB0D0Vyx_Gvg +Added: _$ss18DiscontiguousSliceV10startIndexAB0D0Vyx_GvpMV +Added: _$ss18DiscontiguousSliceV11descriptionSSvg +Added: _$ss18DiscontiguousSliceV11descriptionSSvpMV +Added: _$ss18DiscontiguousSliceV20_failEarlyRangeCheck_6boundsyAB5IndexVyx_G_SNyAGGtF +Added: _$ss18DiscontiguousSliceV20_failEarlyRangeCheck_6boundsyAB5IndexVyx_G_SnyAGGtF +Added: _$ss18DiscontiguousSliceV20_failEarlyRangeCheck_6boundsySnyAB5IndexVyx_GG_AHtF +Added: _$ss18DiscontiguousSliceV22_copyToContiguousArrays0eF0Vy7ElementQzGyF +Added: _$ss18DiscontiguousSliceV30_customIndexOfEquatableElementyAB0D0Vyx_GSgSg0G0QzF +Added: _$ss18DiscontiguousSliceV31_customContainsEquatableElementySbSg0F0QzF +Added: _$ss18DiscontiguousSliceV34_customLastIndexOfEquatableElementyAB0E0Vyx_GSgSg0H0QzF +Added: _$ss18DiscontiguousSliceV4basexvg +Added: _$ss18DiscontiguousSliceV4basexvpMV +Added: _$ss18DiscontiguousSliceV5IndexV11descriptionSSvg +Added: _$ss18DiscontiguousSliceV5IndexV11descriptionSSvpMV +Added: _$ss18DiscontiguousSliceV5IndexV1loiySbADyx_G_AFtFZ +Added: _$ss18DiscontiguousSliceV5IndexV2eeoiySbADyx_G_AFtFZ +Added: _$ss18DiscontiguousSliceV5IndexV4baseACQzvg +Added: _$ss18DiscontiguousSliceV5IndexV4baseACQzvpMV +Added: _$ss18DiscontiguousSliceV5IndexVMa +Added: _$ss18DiscontiguousSliceV5IndexVMn +Added: _$ss18DiscontiguousSliceV5IndexVsSHACRpzrlE4hash4intoys6HasherVz_tF +Added: _$ss18DiscontiguousSliceV5IndexVsSHACRpzrlE9hashValueSivg +Added: _$ss18DiscontiguousSliceV5IndexVsSHACRpzrlE9hashValueSivpMV +Added: _$ss18DiscontiguousSliceV5IndexVyx_GSHsSHACRpzrlMc +Added: _$ss18DiscontiguousSliceV5IndexVyx_GSLsMc +Added: _$ss18DiscontiguousSliceV5IndexVyx_GSLsWP +Added: _$ss18DiscontiguousSliceV5IndexVyx_GSQsMc +Added: _$ss18DiscontiguousSliceV5IndexVyx_GSQsWP +Added: _$ss18DiscontiguousSliceV5IndexVyx_Gs23CustomStringConvertiblesMc +Added: _$ss18DiscontiguousSliceV5IndexVyx_Gs23CustomStringConvertiblesWP +Added: _$ss18DiscontiguousSliceV5_base9subrangesAByxGx_s8RangeSetVy5IndexQzGtcfC +Added: _$ss18DiscontiguousSliceV5countSivg +Added: _$ss18DiscontiguousSliceV5countSivpMV +Added: _$ss18DiscontiguousSliceV5index5afterAB5IndexVyx_GAG_tF +Added: _$ss18DiscontiguousSliceV6_index2ofAB5IndexVyx_GSgAEQz_tF +Added: _$ss18DiscontiguousSliceV7isEmptySbvg +Added: _$ss18DiscontiguousSliceV7isEmptySbvpMV +Added: _$ss18DiscontiguousSliceV8distance4from2toSiAB5IndexVyx_G_AHtF +Added: _$ss18DiscontiguousSliceV8endIndexAB0D0Vyx_Gvg +Added: _$ss18DiscontiguousSliceV8endIndexAB0D0Vyx_GvpMV +Added: _$ss18DiscontiguousSliceV9subrangess8RangeSetVy5IndexQzGvg +Added: _$ss18DiscontiguousSliceV9subrangess8RangeSetVy5IndexQzGvpMV +Added: _$ss18DiscontiguousSliceVMa +Added: _$ss18DiscontiguousSliceVMn +Added: _$ss18DiscontiguousSliceVsSH7ElementRpzrlE4hash4intoys6HasherVz_tF +Added: _$ss18DiscontiguousSliceVsSH7ElementRpzrlE9hashValueSivg +Added: _$ss18DiscontiguousSliceVsSH7ElementRpzrlE9hashValueSivpMV +Added: _$ss18DiscontiguousSliceVsSKRzrlE5index6beforeAB5IndexVyx_GAG_tF +Added: _$ss18DiscontiguousSliceVsSMRzrlEy7ElementQzAB5IndexVyx_GciM +Added: _$ss18DiscontiguousSliceVsSMRzrlEy7ElementQzAB5IndexVyx_Gcig +Added: _$ss18DiscontiguousSliceVsSMRzrlEy7ElementQzAB5IndexVyx_GcipMV +Added: _$ss18DiscontiguousSliceVsSMRzrlEy7ElementQzAB5IndexVyx_Gcis +Added: _$ss18DiscontiguousSliceVsSQ7ElementRpzrlE2eeoiySbAByxG_AFtFZ +Added: _$ss18DiscontiguousSliceVy7ElementQzAB5IndexVyx_Gcig +Added: _$ss18DiscontiguousSliceVy7ElementQzAB5IndexVyx_GcipMV +Added: _$ss18DiscontiguousSliceVyAByxGSnyAB5IndexVyx_GGcig +Added: _$ss18DiscontiguousSliceVyAByxGSnyAB5IndexVyx_GGcipMV +Added: _$ss18DiscontiguousSliceVyxGSHsSH7ElementRpzrlMc +Added: _$ss18DiscontiguousSliceVyxGSKsSKRzrlMc +Added: _$ss18DiscontiguousSliceVyxGSQsSQ7ElementRpzrlMc +Added: _$ss18DiscontiguousSliceVyxGSTsMc +Added: _$ss18DiscontiguousSliceVyxGSlsMc +Added: _$ss18DiscontiguousSliceVyxGs23CustomStringConvertiblesMc +Added: _$ss18DiscontiguousSliceVyxGs23CustomStringConvertiblesWP + +// (extension in Swift):Swift.MutableCollection.subscript.modify : (Swift.RangeSet) -> Swift.DiscontiguousSlice +Added: _$sSMsEys18DiscontiguousSliceVyxGs8RangeSetVy5IndexQzGciM + +// (extension in Swift):Swift.MutableCollection.subscript.getter : (Swift.RangeSet) -> Swift.DiscontiguousSlice +Added: _$sSMsEys18DiscontiguousSliceVyxGs8RangeSetVy5IndexQzGcig + +// property descriptor for (extension in Swift):Swift.MutableCollection.subscript(Swift.RangeSet) -> Swift.DiscontiguousSlice +Added: _$sSMsEys18DiscontiguousSliceVyxGs8RangeSetVy5IndexQzGcipMV + +// (extension in Swift):Swift.MutableCollection.subscript.setter : (Swift.RangeSet) -> Swift.DiscontiguousSlice +Added: _$sSMsEys18DiscontiguousSliceVyxGs8RangeSetVy5IndexQzGcis + +// (extension in Swift):Swift.Collection.removingSubranges(Swift.RangeSet) -> Swift.DiscontiguousSlice +Added: _$sSlsE17removingSubrangesys18DiscontiguousSliceVyxGs8RangeSetVy5IndexQzGF + +// (extension in Swift):Swift.Collection.subscript.getter : (Swift.RangeSet) -> Swift.DiscontiguousSlice +Added: _$sSlsEys18DiscontiguousSliceVyxGs8RangeSetVy5IndexQzGcig + +// property descriptor for (extension in Swift):Swift.Collection.subscript(Swift.RangeSet) -> Swift.DiscontiguousSlice +Added: _$sSlsEys18DiscontiguousSliceVyxGs8RangeSetVy5IndexQzGcipMV + +// struct RangeSet +Added: _$ss8RangeSetV10isDisjointySbAByxGF +Added: _$ss8RangeSetV10isSuperset2ofSbAByxG_tF +Added: _$ss8RangeSetV11descriptionSSvg +Added: _$ss8RangeSetV11descriptionSSvpMV +Added: _$ss8RangeSetV11subtractingyAByxGADF +Added: _$ss8RangeSetV12intersectionyAByxGADF +Added: _$ss8RangeSetV14_orderedRangesAByxGSaySnyxGG_tcfC +Added: _$ss8RangeSetV14isStrictSubset2ofSbAByxG_tF +Added: _$ss8RangeSetV16_checkInvariantsyyF +Added: _$ss8RangeSetV16formIntersectionyyAByxGF +Added: _$ss8RangeSetV16isStrictSuperset2ofSbAByxG_tF +Added: _$ss8RangeSetV19symmetricDifferenceyAByxGADnF +Added: _$ss8RangeSetV23formSymmetricDifferenceyyAByxGnF +Added: _$ss8RangeSetV2eeoiySbAByxG_ADtFZ +Added: _$ss8RangeSetV5unionyAByxGADnF +Added: _$ss8RangeSetV6RangesV010_indicesOfA0_2in15includeAdjacentSnySiGSnyxG_s15ContiguousArrayVyAIGSbtF +Added: _$ss8RangeSetV6RangesV010_unorderedC0ADyx_GSaySnyxGG_tcfC +Added: _$ss8RangeSetV6RangesV10startIndexSivg +Added: _$ss8RangeSetV6RangesV10startIndexSivpMV +Added: _$ss8RangeSetV6RangesV11descriptionSSvg +Added: _$ss8RangeSetV6RangesV11descriptionSSvpMV +Added: _$ss8RangeSetV6RangesV13_intersectionyADyx_GAFF +Added: _$ss8RangeSetV6RangesV2eeoiySbADyx_G_AFtFZ +Added: _$ss8RangeSetV6RangesV5_gaps9boundedByADyx_GSnyxG_tF +Added: _$ss8RangeSetV6RangesV5countSivg +Added: _$ss8RangeSetV6RangesV5countSivpMV +Added: _$ss8RangeSetV6RangesV6_rangeADyx_GSnyxG_tcfC +Added: _$ss8RangeSetV6RangesV7_insert10contentsOfySnyxG_tF +Added: _$ss8RangeSetV6RangesV7_rangesADyx_GSaySnyxGG_tcfC +Added: _$ss8RangeSetV6RangesV7_remove10contentsOfySnyxG_tF +Added: _$ss8RangeSetV6RangesV8endIndexSivg +Added: _$ss8RangeSetV6RangesV8endIndexSivpMV +Added: _$ss8RangeSetV6RangesV9_containsySbxF +Added: _$ss8RangeSetV6RangesVADyx_GycfC +Added: _$ss8RangeSetV6RangesVMa +Added: _$ss8RangeSetV6RangesVMn +Added: _$ss8RangeSetV6RangesVsSHRzrlE4hash4intoys6HasherVz_tF +Added: _$ss8RangeSetV6RangesVsSHRzrlE9hashValueSivg +Added: _$ss8RangeSetV6RangesVsSHRzrlE9hashValueSivpMV +Added: _$ss8RangeSetV6RangesVySnyxGSicig +Added: _$ss8RangeSetV6RangesVySnyxGSicipMV +Added: _$ss8RangeSetV6RangesVyx_GSHsSHRzrlMc +Added: _$ss8RangeSetV6RangesVyx_GSKsMc +Added: _$ss8RangeSetV6RangesVyx_GSQsMc +Added: _$ss8RangeSetV6RangesVyx_GSQsWP +Added: _$ss8RangeSetV6RangesVyx_GSTsMc +Added: _$ss8RangeSetV6RangesVyx_GSksMc +Added: _$ss8RangeSetV6RangesVyx_GSlsMc +Added: _$ss8RangeSetV6RangesVyx_Gs23CustomStringConvertiblesMc +Added: _$ss8RangeSetV6RangesVyx_Gs23CustomStringConvertiblesWP +Added: _$ss8RangeSetV6insert10contentsOfySnyxG_tF +Added: _$ss8RangeSetV6insert_6withinyx_qd__t5IndexQyd__RszSlRd__lF +Added: _$ss8RangeSetV6rangesAB6RangesVyx_Gvg +Added: _$ss8RangeSetV6rangesAB6RangesVyx_GvpMV +Added: _$ss8RangeSetV6remove10contentsOfySnyxG_tF +Added: _$ss8RangeSetV6remove_6withinyx_qd__t5IndexQyd__RszSlRd__lF +Added: _$ss8RangeSetV7_rangesAB6RangesVyx_GvM +Added: _$ss8RangeSetV7_rangesAB6RangesVyx_Gvg +Added: _$ss8RangeSetV7_rangesAB6RangesVyx_GvpMV +Added: _$ss8RangeSetV7_rangesAB6RangesVyx_Gvs +Added: _$ss8RangeSetV7_rangesAByxGAB6RangesVyx_G_tcfC +Added: _$ss8RangeSetV7isEmptySbvg +Added: _$ss8RangeSetV7isEmptySbvpMV +Added: _$ss8RangeSetV8containsySbxF +Added: _$ss8RangeSetV8isSubset2ofSbAByxG_tF +Added: _$ss8RangeSetV8subtractyyAByxGF +Added: _$ss8RangeSetV9_inverted6withinAByxGqd___t5IndexQyd__RszSlRd__lF +Added: _$ss8RangeSetV9formUnionyyAByxGnF +Added: _$ss8RangeSetVAByxGycfC +Added: _$ss8RangeSetVMa +Added: _$ss8RangeSetVMn +Added: _$ss8RangeSetV_6withinAByxGqd___qd_0_tc7ElementQyd__RszSTRd__SlRd_0_5IndexQyd_0_AFRSr0_lufC +Added: _$ss8RangeSetVsSHRzrlE4hash4intoys6HasherVz_tF +Added: _$ss8RangeSetVsSHRzrlE9hashValueSivg +Added: _$ss8RangeSetVsSHRzrlE9hashValueSivpMV +Added: _$ss8RangeSetVyAByxGSnyxGcfC +Added: _$ss8RangeSetVyAByxGqd__cSTRd__SnyxG7ElementRtd__lufC +Added: _$ss8RangeSetVyxGSHsSHRzrlMc +Added: _$ss8RangeSetVyxGSQsMc +Added: _$ss8RangeSetVyxGSQsWP +Added: _$ss8RangeSetVyxGs23CustomStringConvertiblesMc +Added: _$ss8RangeSetVyxGs23CustomStringConvertiblesWP + +// (extension in Swift):Swift.Collection< where A.Element: Swift.Equatable>.indices(of: A.Element) -> Swift.RangeSet +Added: _$sSlsSQ7ElementRpzrlE7indices2ofs8RangeSetVy5IndexQzGAB_tF + +// (extension in Swift):Swift.RangeReplaceableCollection.removeSubranges(Swift.RangeSet) -> () +Added: _$sSmsE15removeSubrangesyys8RangeSetVy5IndexQzGF + +// (extension in Swift):Swift.Collection.indices(where: (A.Element) throws -> Swift.Bool) throws -> Swift.RangeSet +Added: _$sSlsE7indices5wheres8RangeSetVy5IndexQzGSb7ElementQzKXE_tKF + +// (extension in Swift):Swift.MutableCollection< where A: Swift.RangeReplaceableCollection>.removeSubranges(Swift.RangeSet) -> () +Added: _$sSMsSmRzrlE15removeSubrangesyys8RangeSetVy5IndexSlQzGF + +// (extension in Swift):Swift.MutableCollection.moveSubranges(_: Swift.RangeSet, to: A.Index) -> Swift.Range +Added: _$sSMsE13moveSubranges_2toSny5IndexQzGs8RangeSetVyADG_ADtF + // Runtime Symbols From 45cdbfeb109b05d36e7518003c6b25f46ed48c4e Mon Sep 17 00:00:00 2001 From: Jeremy Schonfeld Date: Thu, 4 Jan 2024 14:44:09 -0800 Subject: [PATCH 14/17] Remove MutableCollection extension for DiscontiguousSlice --- stdlib/public/core/DiscontiguousSlice.swift | 40 --------------------- validation-test/stdlib/RangeSet.swift | 18 ---------- 2 files changed, 58 deletions(-) diff --git a/stdlib/public/core/DiscontiguousSlice.swift b/stdlib/public/core/DiscontiguousSlice.swift index 05b085855e7e4..7e02de5720985 100644 --- a/stdlib/public/core/DiscontiguousSlice.swift +++ b/stdlib/public/core/DiscontiguousSlice.swift @@ -380,46 +380,6 @@ extension Collection { } } -extension MutableCollection { - /// Accesses a mutable view of this collection with the elements at the - /// given indices. - /// - /// - Parameter subranges: The ranges of the elements to retrieve from this - /// collection. - /// - Returns: A collection of the elements at the positions in `subranges`. - /// - /// - Complexity: O(1) to access the elements, O(*m*) to mutate the - /// elements at the positions in `subranges`, where *m* is the number of - /// elements indicated by `subranges`. - @available(SwiftStdlib 5.11, *) - public subscript(subranges: RangeSet) -> DiscontiguousSlice { - get { - DiscontiguousSlice(_base: self, subranges: subranges) - } - set { - var indexOfReplacement = newValue.startIndex - for range in subranges.ranges { - _debugPrecondition(!range.isEmpty, "Empty range in a range set") - - var indexToReplace = range.lowerBound - repeat { - _precondition( - indexOfReplacement < newValue.endIndex, - "Attempt to replace discontinuous slice with too few elements") - - self[indexToReplace] = newValue[indexOfReplacement] - self.formIndex(after: &indexToReplace) - newValue.formIndex(after: &indexOfReplacement) - } while indexToReplace < range.upperBound - } - - _precondition( - indexOfReplacement == newValue.endIndex, - "Attempt to replace discontinuous slice with too many elements") - } - } -} - extension Collection { /// Returns a collection of the elements in this collection that are not diff --git a/validation-test/stdlib/RangeSet.swift b/validation-test/stdlib/RangeSet.swift index 1cdfae8b52a6e..f0cb89c871886 100644 --- a/validation-test/stdlib/RangeSet.swift +++ b/validation-test/stdlib/RangeSet.swift @@ -534,24 +534,6 @@ if #available(SwiftStdlib 5.11, *) { expectEqualSequence(string[set].reversed(), expected.reversed()) } } - - RangeSetTests.test("DiscontiguousSliceMutating/TooLarge") { - var initial = Array(1...21) - let evens = initial.indices(where: { $0.isMultiple(of: 2) }) - let odds = initial.indices(where: { !$0.isMultiple(of: 2) }) - - expectCrashLater() - initial[evens] = initial[odds] - } - - RangeSetTests.test("DiscontiguousSliceMutating/TooSmall") { - var initial = Array(1...21) - let evens = initial.indices(where: { $0.isMultiple(of: 2) }) - let odds = initial.indices(where: { !$0.isMultiple(of: 2) }) - - expectCrashLater() - initial[odds] = initial[evens] - } } runAllTests() From 53ced85071ec602c0b5e752cd4056ad6e8f9d20f Mon Sep 17 00:00:00 2001 From: Jeremy Schonfeld Date: Thu, 4 Jan 2024 14:45:00 -0800 Subject: [PATCH 15/17] Make insertion return a discardable Bool --- stdlib/public/core/RangeSet.swift | 8 +++-- stdlib/public/core/RangeSetRanges.swift | 30 +++++++++------- validation-test/stdlib/RangeSet.swift | 47 +++++++++++++++++++++++++ 3 files changed, 71 insertions(+), 14 deletions(-) diff --git a/stdlib/public/core/RangeSet.swift b/stdlib/public/core/RangeSet.swift index 05d73a739e643..2eb77cd1ed762 100644 --- a/stdlib/public/core/RangeSet.swift +++ b/stdlib/public/core/RangeSet.swift @@ -195,12 +195,16 @@ extension RangeSet { /// valid index of `collection` that isn't the collection's `endIndex`. /// - collection: The collection that contains `index`. /// + /// - Returns: `true` if the range set was modified, or `false` if + /// the given `index` was already in the range set. + /// /// - Complexity: O(*n*), where *n* is the number of ranges in the range /// set. + @discardableResult public mutating func insert( _ index: Bound, within collection: C - ) where C.Index == Bound { - insert(contentsOf: index ..< collection.index(after: index)) + ) -> Bool where C.Index == Bound { + _ranges._insert(contentsOf: index ..< collection.index(after: index)) } /// Removes the range that contains only the specified index from the range diff --git a/stdlib/public/core/RangeSetRanges.swift b/stdlib/public/core/RangeSetRanges.swift index ceff04843c5db..3db430dc94597 100644 --- a/stdlib/public/core/RangeSetRanges.swift +++ b/stdlib/public/core/RangeSetRanges.swift @@ -128,18 +128,24 @@ extension RangeSet.Ranges { // Insert a non-empty range into the storage @usableFromInline - internal mutating func _insert(contentsOf range: Range) { - let indices = _indicesOfRange(range, in: _storage) - if indices.isEmpty { - _storage.insert(range, at: indices.lowerBound) - } else { - let lower = Swift.min( - _storage[indices.lowerBound].lowerBound, range.lowerBound) - let upper = Swift.max( - _storage[indices.upperBound - 1].upperBound, range.upperBound) - _storage.replaceSubrange( - indices, with: CollectionOfOne(lower ..< upper)) - } + @discardableResult + internal mutating func _insert(contentsOf range: Range) -> Bool { + let indices = _indicesOfRange(range, in: _storage) + if indices.isEmpty { + _storage.insert(range, at: indices.lowerBound) + return true + } else { + let lower = Swift.min( + _storage[indices.lowerBound].lowerBound, range.lowerBound) + let upper = Swift.max( + _storage[indices.upperBound - 1].upperBound, range.upperBound) + let newRange = lower ..< upper + if indices.count == 1 && newRange == _storage[indices.lowerBound] { + return false + } + _storage.replaceSubrange(indices, with: CollectionOfOne(newRange)) + return true + } } // Remove a non-empty range from the storage diff --git a/validation-test/stdlib/RangeSet.swift b/validation-test/stdlib/RangeSet.swift index f0cb89c871886..ae6329d5612b4 100644 --- a/validation-test/stdlib/RangeSet.swift +++ b/validation-test/stdlib/RangeSet.swift @@ -534,6 +534,53 @@ if #available(SwiftStdlib 5.11, *) { expectEqualSequence(string[set].reversed(), expected.reversed()) } } + + RangeSetTests.test("InsertionReturningPreviousContainment") { + do { + var s = RangeSet() + expectTrue(s.insert(20, within: parent)) + } + do { + var s = source + expectTrue(s.insert(-100, within: parent)) + } + do { + var s = source + expectFalse(s.insert(20, within: parent)) + } + do { + var s = source + expectFalse(s.insert(21, within: parent)) + } + do { + var s = source + expectTrue(s.insert(22, within: parent)) + } + do { + var s = source + expectTrue(s.insert(23, within: parent)) + } + do { + var s = source + expectTrue(s.insert(26, within: parent)) + } + do { + var s = source + expectFalse(s.insert(27, within: parent)) + } + do { + var s = source + expectFalse(s.insert(28, within: parent)) + } + do { + var s = source + expectTrue(s.insert(29, within: parent)) + } + do { + var s = source + expectTrue(s.insert(100, within: parent)) + } + } } runAllTests() From ee71761aa7a6549faff649d5bd7def95e46367e6 Mon Sep 17 00:00:00 2001 From: Jeremy Schonfeld Date: Thu, 4 Jan 2024 14:52:11 -0800 Subject: [PATCH 16/17] Fix ABI checker tests --- test/abi/macOS/arm64/stdlib.swift | 16 ++-------------- test/abi/macOS/x86_64/stdlib.swift | 16 ++-------------- 2 files changed, 4 insertions(+), 28 deletions(-) diff --git a/test/abi/macOS/arm64/stdlib.swift b/test/abi/macOS/arm64/stdlib.swift index 6f3d0ef02645d..e6f686b3b8948 100644 --- a/test/abi/macOS/arm64/stdlib.swift +++ b/test/abi/macOS/arm64/stdlib.swift @@ -131,18 +131,6 @@ Added: _$ss18DiscontiguousSliceVyxGSlsMc Added: _$ss18DiscontiguousSliceVyxGs23CustomStringConvertiblesMc Added: _$ss18DiscontiguousSliceVyxGs23CustomStringConvertiblesWP -// (extension in Swift):Swift.MutableCollection.subscript.modify : (Swift.RangeSet) -> Swift.DiscontiguousSlice -Added: _$sSMsEys18DiscontiguousSliceVyxGs8RangeSetVy5IndexQzGciM - -// (extension in Swift):Swift.MutableCollection.subscript.getter : (Swift.RangeSet) -> Swift.DiscontiguousSlice -Added: _$sSMsEys18DiscontiguousSliceVyxGs8RangeSetVy5IndexQzGcig - -// property descriptor for (extension in Swift):Swift.MutableCollection.subscript(Swift.RangeSet) -> Swift.DiscontiguousSlice -Added: _$sSMsEys18DiscontiguousSliceVyxGs8RangeSetVy5IndexQzGcipMV - -// (extension in Swift):Swift.MutableCollection.subscript.setter : (Swift.RangeSet) -> Swift.DiscontiguousSlice -Added: _$sSMsEys18DiscontiguousSliceVyxGs8RangeSetVy5IndexQzGcis - // (extension in Swift):Swift.Collection.removingSubranges(Swift.RangeSet) -> Swift.DiscontiguousSlice Added: _$sSlsE17removingSubrangesys18DiscontiguousSliceVyxGs8RangeSetVy5IndexQzGF @@ -180,7 +168,7 @@ Added: _$ss8RangeSetV6RangesV5_gaps9boundedByADyx_GSnyxG_tF Added: _$ss8RangeSetV6RangesV5countSivg Added: _$ss8RangeSetV6RangesV5countSivpMV Added: _$ss8RangeSetV6RangesV6_rangeADyx_GSnyxG_tcfC -Added: _$ss8RangeSetV6RangesV7_insert10contentsOfySnyxG_tF +Added: _$ss8RangeSetV6RangesV7_insert10contentsOfSbSnyxG_tF Added: _$ss8RangeSetV6RangesV7_rangesADyx_GSaySnyxGG_tcfC Added: _$ss8RangeSetV6RangesV7_remove10contentsOfySnyxG_tF Added: _$ss8RangeSetV6RangesV8endIndexSivg @@ -203,8 +191,8 @@ Added: _$ss8RangeSetV6RangesVyx_GSksMc Added: _$ss8RangeSetV6RangesVyx_GSlsMc Added: _$ss8RangeSetV6RangesVyx_Gs23CustomStringConvertiblesMc Added: _$ss8RangeSetV6RangesVyx_Gs23CustomStringConvertiblesWP +Added: _$ss8RangeSetV6insert_6withinSbx_qd__t5IndexQyd__RszSlRd__lF Added: _$ss8RangeSetV6insert10contentsOfySnyxG_tF -Added: _$ss8RangeSetV6insert_6withinyx_qd__t5IndexQyd__RszSlRd__lF Added: _$ss8RangeSetV6rangesAB6RangesVyx_Gvg Added: _$ss8RangeSetV6rangesAB6RangesVyx_GvpMV Added: _$ss8RangeSetV6remove10contentsOfySnyxG_tF diff --git a/test/abi/macOS/x86_64/stdlib.swift b/test/abi/macOS/x86_64/stdlib.swift index 948a24e132a13..b386e5feb2d76 100644 --- a/test/abi/macOS/x86_64/stdlib.swift +++ b/test/abi/macOS/x86_64/stdlib.swift @@ -131,18 +131,6 @@ Added: _$ss18DiscontiguousSliceVyxGSlsMc Added: _$ss18DiscontiguousSliceVyxGs23CustomStringConvertiblesMc Added: _$ss18DiscontiguousSliceVyxGs23CustomStringConvertiblesWP -// (extension in Swift):Swift.MutableCollection.subscript.modify : (Swift.RangeSet) -> Swift.DiscontiguousSlice -Added: _$sSMsEys18DiscontiguousSliceVyxGs8RangeSetVy5IndexQzGciM - -// (extension in Swift):Swift.MutableCollection.subscript.getter : (Swift.RangeSet) -> Swift.DiscontiguousSlice -Added: _$sSMsEys18DiscontiguousSliceVyxGs8RangeSetVy5IndexQzGcig - -// property descriptor for (extension in Swift):Swift.MutableCollection.subscript(Swift.RangeSet) -> Swift.DiscontiguousSlice -Added: _$sSMsEys18DiscontiguousSliceVyxGs8RangeSetVy5IndexQzGcipMV - -// (extension in Swift):Swift.MutableCollection.subscript.setter : (Swift.RangeSet) -> Swift.DiscontiguousSlice -Added: _$sSMsEys18DiscontiguousSliceVyxGs8RangeSetVy5IndexQzGcis - // (extension in Swift):Swift.Collection.removingSubranges(Swift.RangeSet) -> Swift.DiscontiguousSlice Added: _$sSlsE17removingSubrangesys18DiscontiguousSliceVyxGs8RangeSetVy5IndexQzGF @@ -180,7 +168,7 @@ Added: _$ss8RangeSetV6RangesV5_gaps9boundedByADyx_GSnyxG_tF Added: _$ss8RangeSetV6RangesV5countSivg Added: _$ss8RangeSetV6RangesV5countSivpMV Added: _$ss8RangeSetV6RangesV6_rangeADyx_GSnyxG_tcfC -Added: _$ss8RangeSetV6RangesV7_insert10contentsOfySnyxG_tF +Added: _$ss8RangeSetV6RangesV7_insert10contentsOfSbSnyxG_tF Added: _$ss8RangeSetV6RangesV7_rangesADyx_GSaySnyxGG_tcfC Added: _$ss8RangeSetV6RangesV7_remove10contentsOfySnyxG_tF Added: _$ss8RangeSetV6RangesV8endIndexSivg @@ -203,8 +191,8 @@ Added: _$ss8RangeSetV6RangesVyx_GSksMc Added: _$ss8RangeSetV6RangesVyx_GSlsMc Added: _$ss8RangeSetV6RangesVyx_Gs23CustomStringConvertiblesMc Added: _$ss8RangeSetV6RangesVyx_Gs23CustomStringConvertiblesWP +Added: _$ss8RangeSetV6insert_6withinSbx_qd__t5IndexQyd__RszSlRd__lF Added: _$ss8RangeSetV6insert10contentsOfySnyxG_tF -Added: _$ss8RangeSetV6insert_6withinyx_qd__t5IndexQyd__RszSlRd__lF Added: _$ss8RangeSetV6rangesAB6RangesVyx_Gvg Added: _$ss8RangeSetV6rangesAB6RangesVyx_GvpMV Added: _$ss8RangeSetV6remove10contentsOfySnyxG_tF From 28809eac51d2c5915547fe9cc0f65e3f24c0ef37 Mon Sep 17 00:00:00 2001 From: Jeremy Schonfeld Date: Fri, 5 Jan 2024 13:48:14 -0800 Subject: [PATCH 17/17] Fix other ABI checker tests due to dropping MutableCollection subscript --- ...tability-stdlib-source-x86_64.swift.expected | 9 +++------ .../stability-stdlib-abi-without-asserts.test | 17 +++-------------- 2 files changed, 6 insertions(+), 20 deletions(-) diff --git a/test/api-digester/Outputs/stability-stdlib-source-x86_64.swift.expected b/test/api-digester/Outputs/stability-stdlib-source-x86_64.swift.expected index 6217f2a244789..3a93963485761 100644 --- a/test/api-digester/Outputs/stability-stdlib-source-x86_64.swift.expected +++ b/test/api-digester/Outputs/stability-stdlib-source-x86_64.swift.expected @@ -1,13 +1,10 @@ -Accessor MutableCollection.subscript(_:).Get() has parameter 0 type change from Swift.Range to Swift.RangeSet -Accessor MutableCollection.subscript(_:).Get() has return type change from Swift.Slice to Swift.DiscontiguousSlice -Accessor MutableCollection.subscript(_:).Set() has parameter 0 type change from Swift.Slice to Swift.DiscontiguousSlice -Accessor MutableCollection.subscript(_:).Set() has parameter 1 type change from Swift.Range to Swift.RangeSet +Accessor MutableCollection.subscript(_:).Get() has generic signature change from to > +Accessor MutableCollection.subscript(_:).Set() has generic signature change from to > Protocol CodingKey has added inherited protocol Sendable Protocol CodingKey has generic signature change from to Protocol Error has added inherited protocol Sendable Protocol Error has generic signature change from to -Subscript MutableCollection.subscript(_:) has parameter 0 type change from Swift.Range to Swift.RangeSet -Subscript MutableCollection.subscript(_:) has return type change from Swift.Slice to Swift.DiscontiguousSlice +Subscript MutableCollection.subscript(_:) has generic signature change from to > // Not actually a source break; the typechecker will find these operations on // FixedWidthInteger instead. diff --git a/test/api-digester/stability-stdlib-abi-without-asserts.test b/test/api-digester/stability-stdlib-abi-without-asserts.test index a98ed431158e1..ff6819673bba2 100644 --- a/test/api-digester/stability-stdlib-abi-without-asserts.test +++ b/test/api-digester/stability-stdlib-abi-without-asserts.test @@ -132,19 +132,8 @@ Func ContiguousArray._createNewBuffer(bufferIsUnique:minimumCapacity:growForAppe Func ContiguousArray._reserveCapacityImpl(minimumCapacity:growForAppend:) has been renamed to Func __specialize_class__reserveCapacityImpl(minimumCapacity:growForAppend:) Func ContiguousArray._reserveCapacityImpl(minimumCapacity:growForAppend:) has mangled name changing from 'Swift.ContiguousArray._reserveCapacityImpl(minimumCapacity: Swift.Int, growForAppend: Swift.Bool) -> ()' to 'Swift.ContiguousArray.__specialize_class__reserveCapacityImpl(minimumCapacity: Swift.Int, growForAppend: Swift.Bool) -> ()' -// These haven't actually been changed, rather a new subscript was added. -// But it seems the ABI checker gives a false positive here and detects -// it as a rename instead of an addition -Accessor MutableCollection.subscript(_:).Get() has mangled name changing from '(extension in Swift):Swift.MutableCollection.subscript.getter : (Swift.Range) -> Swift.Slice' to '(extension in Swift):Swift.MutableCollection.subscript.getter : (Swift.RangeSet) -> Swift.DiscontiguousSlice' -Accessor MutableCollection.subscript(_:).Get() has parameter 0 type change from Swift.Range<τ_0_0.Index> to Swift.RangeSet<τ_0_0.Index> -Accessor MutableCollection.subscript(_:).Get() has return type change from Swift.Slice<τ_0_0> to Swift.DiscontiguousSlice<τ_0_0> -Accessor MutableCollection.subscript(_:).Modify() has mangled name changing from '(extension in Swift):Swift.MutableCollection.subscript.modify : (Swift.Range) -> Swift.Slice' to '(extension in Swift):Swift.MutableCollection.subscript.modify : (Swift.RangeSet) -> Swift.DiscontiguousSlice' -Accessor MutableCollection.subscript(_:).Modify() has parameter 0 type change from Swift.Range<τ_0_0.Index> to Swift.RangeSet<τ_0_0.Index> -Accessor MutableCollection.subscript(_:).Set() has mangled name changing from '(extension in Swift):Swift.MutableCollection.subscript.setter : (Swift.Range) -> Swift.Slice' to '(extension in Swift):Swift.MutableCollection.subscript.setter : (Swift.RangeSet) -> Swift.DiscontiguousSlice' -Accessor MutableCollection.subscript(_:).Set() has parameter 0 type change from Swift.Slice<τ_0_0> to Swift.DiscontiguousSlice<τ_0_0> -Accessor MutableCollection.subscript(_:).Set() has parameter 1 type change from Swift.Range<τ_0_0.Index> to Swift.RangeSet<τ_0_0.Index> -Subscript MutableCollection.subscript(_:) has mangled name changing from '(extension in Swift):Swift.MutableCollection.subscript(Swift.Range) -> Swift.Slice' to '(extension in Swift):Swift.MutableCollection.subscript(Swift.RangeSet) -> Swift.DiscontiguousSlice' -Subscript MutableCollection.subscript(_:) has parameter 0 type change from Swift.Range<τ_0_0.Index> to Swift.RangeSet<τ_0_0.Index> -Subscript MutableCollection.subscript(_:) has return type change from Swift.Slice<τ_0_0> to Swift.DiscontiguousSlice<τ_0_0> +// This hasn't actually been changed, but it seems the ABI checker gives a false positive here and detects +// it as a removal with the addition of the RangeSet subscripts +Subscript MutableCollection.subscript(_:) has been removed // *** DO NOT DISABLE OR XFAIL THIS TEST. *** (See comment above.)