Skip to content

Commit

Permalink
_ArrayType => _ArrayProtocol
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxim Moiseev committed Dec 16, 2015
1 parent ca932fc commit db84df9
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions stdlib/public/core/ArrayType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
//===----------------------------------------------------------------------===//

public // @testable
protocol _ArrayType
protocol _ArrayProtocol
: RangeReplaceableCollection,
ArrayLiteralConvertible
{
Expand Down Expand Up @@ -80,8 +80,8 @@ protocol _ArrayType
var _buffer: _Buffer {get}
}

internal struct _ArrayTypeMirror<
T : _ArrayType where T.Index == Int
internal struct _ArrayProtocolMirror<
T : _ArrayProtocol where T.Index == Int
> : _MirrorType {
let _value : T

Expand Down
4 changes: 2 additions & 2 deletions stdlib/public/core/Arrays.swift.gyb
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ public func _deallocateUninitialized${Self}<Element>(
}
%end

extension ${Self} : _ArrayType {
extension ${Self} : _ArrayProtocol {
/// Construct an empty ${Self}.
@_semantics("array.init")
public init() {
Expand Down Expand Up @@ -774,7 +774,7 @@ extension ${Self} : _Reflectable {
/// Returns a mirror that reflects `self`.
@warn_unused_result
public func _getMirror() -> _MirrorType {
return _ArrayTypeMirror(self)
return _ArrayProtocolMirror(self)
}
}

Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/core/Collection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ extension Collection
}

extension Sequence
where Self : _ArrayType, Self.Element == Self.Iterator.Element {
where Self : _ArrayProtocol, Self.Element == Self.Iterator.Element {
// A fast implementation for when you are backed by a contiguous array.
public func _initializeTo(ptr: UnsafeMutablePointer<Iterator.Element>)
-> UnsafeMutablePointer<Iterator.Element> {
Expand Down
6 changes: 3 additions & 3 deletions test/1_stdlib/NewArray.swift.gyb
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,11 @@ func printSequence<T : Sequence>(x: T) {

typealias BufferID = UnsafePointer<Void>

func bufferID<T : _ArrayType>(x: T) -> BufferID {
func bufferID<T : _ArrayProtocol>(x: T) -> BufferID {
return x._buffer.identity
}

func checkReallocation<T : _ArrayType>(
func checkReallocation<T : _ArrayProtocol>(
x: T, _ lastBuffer: BufferID, _ reallocationExpected: Bool
) -> BufferID {
let currentBuffer = bufferID(x)
Expand All @@ -109,7 +109,7 @@ func checkEqual<
}

func test<
T : _ArrayType
T : _ArrayProtocol
where
T.Iterator.Element == T._Buffer.Element,
T._Buffer.Element == T.Element,
Expand Down

0 comments on commit db84df9

Please sign in to comment.