fixed where clauses, Optional-as-Any and unused vars

This commit is contained in:
ben-cohen
2016-12-29 07:58:12 -08:00
parent 474096b9cb
commit ce0d713cd6
17 changed files with 168 additions and 179 deletions

View File

@@ -48,9 +48,8 @@ protocol MyArrayProtocol
func += <
S : Sequence
where
S.Iterator.Element == Iterator.Element
>(lhs: inout Self, rhs: S)
where S.Iterator.Element == Iterator.Element
}
extension MyArrayProtocol {
var _bufferID: _BufferID {
@@ -74,10 +73,10 @@ func checkReallocation<T : MyArrayProtocol>(
func checkEqual<
S1 : Sequence, S2 : Sequence
where
S1.Iterator.Element == S2.Iterator.Element,
S1.Iterator.Element : Equatable
>(_ a1: S1, _ a2: S2, _ expected: Bool) {
>(_ a1: S1, _ a2: S2, _ expected: Bool)
where
S1.Iterator.Element == S2.Iterator.Element,
S1.Iterator.Element : Equatable {
if a1.elementsEqual(a2) != expected {
let un = expected ? "un" : ""
print("unexpectedly \(un)equal sequences!")
@@ -86,12 +85,12 @@ func checkEqual<
func test<
T : MyArrayProtocol
where
T.Iterator.Element == LifetimeTracked,
T.Iterator.Element == T.Element,
T.Index == Int,
T.IndexDistance == Int
>(_: T.Type, _ label: String) {
>(_: T.Type, _ label: String)
where
T.Iterator.Element == LifetimeTracked,
T.Iterator.Element == T.Element,
T.Index == Int,
T.IndexDistance == Int {
print("test: \(label)...", terminator: "")
var x: T = [