mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
fixed where clauses, Optional-as-Any and unused vars
This commit is contained in:
@@ -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 = [
|
||||
|
||||
Reference in New Issue
Block a user