[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:
Ben Cohen
2017-05-14 06:33:25 -07:00
committed by GitHub
parent 2e275e3a13
commit ea2f64cad2
78 changed files with 503 additions and 500 deletions

View File

@@ -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