@@ -38,19 +38,16 @@ protocol MyArrayProtocol
38
38
: RandomAccessCollection ,
39
39
RangeReplaceableCollection ,
40
40
MutableCollection ,
41
- ArrayLiteralConvertible {
41
+ ExpressibleByArrayLiteral {
42
42
43
43
associatedtype Iterator : IteratorProtocol
44
44
45
45
var _owner : AnyObject ? { get }
46
46
47
47
var capacity : Int { get }
48
48
49
- func += <
50
- S : Sequence
51
- where
52
- S. Iterator. Element == Iterator . Element
53
- > ( lhs: inout Self , rhs: S )
49
+ static func += < S : Sequence > ( lhs: inout Self , rhs: S )
50
+ where S. Iterator. Element == Iterator . Element
54
51
}
55
52
extension MyArrayProtocol {
56
53
var _bufferID : _BufferID {
@@ -72,26 +69,27 @@ func checkReallocation<T : MyArrayProtocol>(
72
69
return currentBuffer
73
70
}
74
71
75
- func checkEqual<
76
- S1 : Sequence , S2 : Sequence
72
+ func checkEqual< S1 : Sequence , S2 : Sequence > (
73
+ _ a1: S1 , _ a2: S2 , _ expected: Bool
74
+ )
77
75
where
78
76
S1. Iterator. Element == S2 . Iterator . Element ,
79
- S1. Iterator. Element : Equatable
80
- > ( _ a1: S1 , _ a2: S2 , _ expected: Bool ) {
77
+ S1. Iterator. Element : Equatable {
78
+
79
+
81
80
if a1. elementsEqual ( a2) != expected {
82
81
let un = expected ? " un " : " "
83
82
print ( " unexpectedly \( un) equal sequences! " )
84
83
}
85
84
}
86
85
87
- func test<
88
- T : MyArrayProtocol
89
- where
86
+ func test< T : MyArrayProtocol > ( _: T . Type , _ label: String )
87
+ where
90
88
T. Iterator. Element == LifetimeTracked ,
91
89
T. Iterator. Element == T . Element ,
92
90
T. Index == Int ,
93
- T. IndexDistance == Int
94
- > ( _ : T . Type , _ label : String ) {
91
+ T. IndexDistance == Int {
92
+
95
93
print ( " test: \( label) ... " , terminator: " " )
96
94
97
95
var x : T = [
0 commit comments