mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[stdlib] Add Sequence.Element, change ExpressibleByArrayLiteral.Element to ArrayLiteralElement (#8990)
* Give Sequence a top-level Element, constrain Iterator to match * Remove many instances of Iterator. * Fixed various hard-coded tests * XFAIL a few tests that need further investigation * Change assoc type for arrayLiteralConvertible * Mop up remaining "better expressed as a where clause" warnings * Fix UnicodeDecoders prototype test * Fix UIntBuffer * Fix hard-coded Element identifier in CSDiag * Fix up more tests * Account for flatMap changes
This commit is contained in:
@@ -21,9 +21,6 @@ internal protocol _ArrayBufferProtocol
|
||||
: RandomAccessCollection
|
||||
= CountableRange<Int>
|
||||
|
||||
/// The type of elements stored in the buffer.
|
||||
associatedtype Element
|
||||
|
||||
/// Create an empty buffer.
|
||||
init()
|
||||
|
||||
@@ -79,7 +76,7 @@ internal protocol _ArrayBufferProtocol
|
||||
_ subrange: Range<Int>,
|
||||
with newCount: Int,
|
||||
elementsOf newValues: C
|
||||
) where C : Collection, C.Iterator.Element == Element
|
||||
) where C : Collection, C.Element == Element
|
||||
|
||||
/// Returns a `_SliceBuffer` containing the elements in `bounds`.
|
||||
subscript(bounds: Range<Int>) -> _SliceBuffer<Element> { get }
|
||||
@@ -144,7 +141,7 @@ extension _ArrayBufferProtocol {
|
||||
_ subrange: Range<Int>,
|
||||
with newCount: Int,
|
||||
elementsOf newValues: C
|
||||
) where C : Collection, C.Iterator.Element == Element {
|
||||
) where C : Collection, C.Element == Element {
|
||||
_sanityCheck(startIndex == 0, "_SliceBuffer should override this function.")
|
||||
let oldCount = self.count
|
||||
let eraseCount = subrange.count
|
||||
|
||||
Reference in New Issue
Block a user