stdlib: Remove unavavailable APIs that were left as migration aids

These APIs are from the Swift 1.2 => Swift 2.0 transition, and are not
relevant anymore.

Removing them reduces the surface area of the library that needs to be
reviewed.
This commit is contained in:
Dmitri Gribenko
2015-12-02 01:19:50 -08:00
parent 047e4002af
commit 174d475833
50 changed files with 16 additions and 1195 deletions

View File

@@ -32,11 +32,6 @@ public extension CGPoint {
init(x: Double, y: Double) { init(x: Double, y: Double) {
self.init(x: CGFloat(x), y: CGFloat(y)) self.init(x: CGFloat(x), y: CGFloat(y))
} }
@available(*, unavailable, renamed="zero")
static var zeroPoint: CGPoint {
fatalError("can't retrieve unavailable property")
}
} }
extension CGPoint : Equatable {} extension CGPoint : Equatable {}
@@ -61,11 +56,6 @@ public extension CGSize {
init(width: Double, height: Double) { init(width: Double, height: Double) {
self.init(width: CGFloat(width), height: CGFloat(height)) self.init(width: CGFloat(width), height: CGFloat(height))
} }
@available(*, unavailable, renamed="zero")
static var zeroSize: CGSize {
fatalError("can't retrieve unavailable property")
}
} }
extension CGSize : Equatable {} extension CGSize : Equatable {}
@@ -90,11 +80,6 @@ public extension CGVector {
init(dx: Double, dy: Double) { init(dx: Double, dy: Double) {
self.init(dx: CGFloat(dx), dy: CGFloat(dy)) self.init(dx: CGFloat(dx), dy: CGFloat(dy))
} }
@available(*, unavailable, renamed="zero")
static var zeroVector: CGVector {
fatalError("can't retrieve unavailable property")
}
} }
extension CGVector : Equatable {} extension CGVector : Equatable {}
@@ -274,87 +259,6 @@ public extension CGRect {
func intersects(rect: CGRect) -> Bool { func intersects(rect: CGRect) -> Bool {
return CGRectIntersectsRect(self, rect) return CGRectIntersectsRect(self, rect)
} }
@available(*, unavailable, renamed="zero")
static var zeroRect: CGRect {
fatalError("can't retrieve unavailable property")
}
@available(*, unavailable, renamed="infinite")
static var infiniteRect: CGRect {
fatalError("can't retrieve unavailable property")
}
@available(*, unavailable, renamed="null")
static var nullRect: CGRect {
fatalError("can't retrieve unavailable property")
}
@available(*, unavailable, renamed="standardized")
var standardizedRect: CGRect {
fatalError("can't retrieve unavailable property")
}
@available(*, unavailable, renamed="integral")
var integerRect: CGRect {
fatalError("can't retrieve unavailable property")
}
@available(*, unavailable, renamed="standardizeInPlace")
mutating func standardize() -> CGRect {
fatalError("can't call unavailable function")
}
@available(*, unavailable, renamed="makeIntegralInPlace")
mutating func integerize() {
fatalError("can't call unavailable function")
}
@available(*, unavailable, renamed="insetBy")
func rectByInsetting(dx dx: CGFloat, dy: CGFloat) -> CGRect {
fatalError("can't call unavailable function")
}
@available(*, unavailable, renamed="insetInPlace")
func inset(dx dx: CGFloat, dy: CGFloat) {
fatalError("can't call unavailable function")
}
@available(*, unavailable, renamed="offsetBy")
func rectByOffsetting(dx dx: CGFloat, dy: CGFloat) -> CGRect {
fatalError("can't call unavailable function")
}
@available(*, unavailable, renamed="offsetInPlace")
func offset(dx dx: CGFloat, dy: CGFloat) {
fatalError("can't call unavailable function")
}
@available(*, unavailable, renamed="unionInPlace")
mutating func union(withRect: CGRect) {
fatalError("can't call unavailable function")
}
@available(*, unavailable, renamed="union")
func rectByUnion(withRect: CGRect) -> CGRect {
fatalError("can't call unavailable function")
}
@available(*, unavailable, renamed="intersectInPlace")
mutating func intersect(withRect: CGRect) {
fatalError("can't call unavailable function")
}
@available(*, unavailable, renamed="intersect")
func rectByIntersecting(withRect: CGRect) -> CGRect {
fatalError("can't call unavailable function")
}
@available(*, unavailable, renamed="divide")
func rectsByDividing(atDistance: CGFloat, fromEdge: CGRectEdge)
-> (slice: CGRect, remainder: CGRect) {
fatalError("can't call unavailable function")
}
} }
extension CGRect : Equatable {} extension CGRect : Equatable {}

View File

@@ -10,39 +10,6 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
/// Returns the minimum element in `elements`.
///
/// - Requires: `elements` is non-empty. O(`elements.count`).
@available(*, unavailable, message="call the 'minElement()' method on the sequence")
public func minElement<
R : SequenceType
where R.Generator.Element : Comparable>(elements: R)
-> R.Generator.Element {
fatalError("unavailable function can't be called")
}
/// Returns the maximum element in `elements`.
///
/// - Requires: `elements` is non-empty. O(`elements.count`).
@available(*, unavailable, message="call the 'maxElement()' method on the sequence")
public func maxElement<
R : SequenceType
where R.Generator.Element : Comparable>(elements: R)
-> R.Generator.Element {
fatalError("unavailable function can't be called")
}
/// Returns the first index where `value` appears in `domain` or `nil` if
/// `value` is not found.
///
/// - Complexity: O(`domain.count`).
@available(*, unavailable, message="call the 'indexOf()' method on the collection")
public func find<
C: CollectionType where C.Generator.Element : Equatable
>(domain: C, _ value: C.Generator.Element) -> C.Index? {
fatalError("unavailable function can't be called")
}
/// Returns the lesser of `x` and `y`. /// Returns the lesser of `x` and `y`.
@warn_unused_result @warn_unused_result
public func min<T : Comparable>(x: T, _ y: T) -> T { public func min<T : Comparable>(x: T, _ y: T) -> T {
@@ -99,53 +66,6 @@ public func max<T : Comparable>(x: T, _ y: T, _ z: T, _ rest: T...) -> T {
return r return r
} }
/// Returns the result of slicing `elements` into sub-sequences that
/// don't contain elements satisfying the predicate `isSeparator`.
///
/// - parameter maxSplit: The maximum number of slices to return, minus 1.
/// If `maxSplit + 1` slices would otherwise be returned, the
/// algorithm stops splitting and returns a suffix of `elements`.
///
/// - parameter allowEmptySlices: If `true`, an empty slice is produced in
/// the result for each pair of consecutive.
@available(*, unavailable, message="Use the split() method instead.")
public func split<S : CollectionType, R : BooleanType>(
elements: S,
maxSplit: Int = Int.max,
allowEmptySlices: Bool = false,
@noescape isSeparator: (S.Generator.Element) -> R
) -> [S.SubSequence] {
fatalError("unavailable function can't be called")
}
/// Returns `true` iff the the initial elements of `s` are equal to `prefix`.
@available(*, unavailable, message="call the 'startsWith()' method on the sequence")
public func startsWith<
S0 : SequenceType, S1 : SequenceType
where
S0.Generator.Element == S1.Generator.Element,
S0.Generator.Element : Equatable
>(s: S0, _ prefix: S1) -> Bool
{
fatalError("unavailable function can't be called")
}
/// Returns `true` iff `s` begins with elements equivalent to those of
/// `prefix`, using `isEquivalent` as the equivalence test.
///
/// - Requires: `isEquivalent` is an [equivalence relation](http://en.wikipedia.org/wiki/Equivalence_relation).
@available(*, unavailable, message="call the 'startsWith()' method on the sequence")
public func startsWith<
S0 : SequenceType, S1 : SequenceType
where
S0.Generator.Element == S1.Generator.Element
>(s: S0, _ prefix: S1,
@noescape _ isEquivalent: (S1.Generator.Element, S1.Generator.Element) -> Bool)
-> Bool
{
fatalError("unavailable function can't be called")
}
/// The `GeneratorType` for `EnumerateSequence`. `EnumerateGenerator` /// The `GeneratorType` for `EnumerateSequence`. `EnumerateGenerator`
/// wraps a `Base` `GeneratorType` and yields successive `Int` values, /// wraps a `Base` `GeneratorType` and yields successive `Int` values,
/// starting at zero, along with the elements of the underlying /// starting at zero, along with the elements of the underlying
@@ -209,105 +129,3 @@ public struct EnumerateSequence<Base : SequenceType> : SequenceType {
} }
} }
/// Returns a lazy `SequenceType` containing pairs (*n*, *x*), where
/// *n*s are consecutive `Int`s starting at zero, and *x*s are
/// the elements of `base`:
///
/// > for (n, c) in enumerate("Swift".characters) {
/// print("\(n): '\(c)'" )
/// }
/// 0: 'S'
/// 1: 'w'
/// 2: 'i'
/// 3: 'f'
/// 4: 't'
@available(*, unavailable, message="call the 'enumerate()' method on the sequence")
public func enumerate<Seq : SequenceType>(
base: Seq
) -> EnumerateSequence<Seq> {
fatalError("unavailable function can't be called")
}
/// Returns `true` iff `a1` and `a2` contain the same elements in the
/// same order.
@available(*, unavailable, message="call the 'equalElements()' method on the sequence")
public func equal<
S1 : SequenceType, S2 : SequenceType
where
S1.Generator.Element == S2.Generator.Element,
S1.Generator.Element : Equatable
>(a1: S1, _ a2: S2) -> Bool {
fatalError("unavailable function can't be called")
}
/// Returns `true` iff `a1` and `a2` contain equivalent elements, using
/// `isEquivalent` as the equivalence test.
///
/// - Requires: `isEquivalent` is an [equivalence relation](http://en.wikipedia.org/wiki/Equivalence_relation).
@available(*, unavailable, message="call the 'equalElements()' method on the sequence")
public func equal<
S1 : SequenceType, S2 : SequenceType
where
S1.Generator.Element == S2.Generator.Element
>(a1: S1, _ a2: S2,
@noescape _ isEquivalent: (S1.Generator.Element, S1.Generator.Element) -> Bool)
-> Bool {
fatalError("unavailable function can't be called")
}
/// Returns `true` iff `a1` precedes `a2` in a lexicographical ("dictionary")
/// ordering, using "<" as the comparison between elements.
@available(*, unavailable, message="call the 'lexicographicalCompare()' method on the sequence")
public func lexicographicalCompare<
S1 : SequenceType, S2 : SequenceType
where
S1.Generator.Element == S2.Generator.Element,
S1.Generator.Element : Comparable>(
a1: S1, _ a2: S2) -> Bool {
fatalError("unavailable function can't be called")
}
/// Returns `true` iff `a1` precedes `a2` in a lexicographical ("dictionary")
/// ordering, using `isOrderedBefore` as the comparison between elements.
///
/// - Requires: `isOrderedBefore` is a
/// [strict weak ordering](http://en.wikipedia.org/wiki/Strict_weak_order#Strict_weak_orderings)
/// over the elements of `a1` and `a2`.
@available(*, unavailable, message="call the 'lexicographicalCompare()' method on the sequence")
public func lexicographicalCompare<
S1 : SequenceType, S2 : SequenceType
where
S1.Generator.Element == S2.Generator.Element
>(
a1: S1, _ a2: S2,
@noescape isOrderedBefore less: (S1.Generator.Element, S1.Generator.Element)
-> Bool
) -> Bool {
fatalError("unavailable function can't be called")
}
/// Returns `true` iff an element in `seq` satisfies `predicate`.
@available(*, unavailable, message="call the 'contains()' method on the sequence")
public func contains<
S : SequenceType, L : BooleanType
>(seq: S, @noescape _ predicate: (S.Generator.Element) -> L) -> Bool {
fatalError("unavailable function can't be called")
}
/// Returns `true` iff `x` is in `seq`.
@available(*, unavailable, message="call the 'contains()' method on the sequence")
public func contains<
S : SequenceType where S.Generator.Element : Equatable
>(seq: S, _ x: S.Generator.Element) -> Bool {
fatalError("unavailable function can't be called")
}
/// Returns the result of repeatedly calling `combine` with an
/// accumulated value initialized to `initial` and each element of
/// `sequence`, in turn.
@available(*, unavailable, message="call the 'reduce()' method on the sequence")
public func reduce<S : SequenceType, U>(
sequence: S, _ initial: U, @noescape _ combine: (U, S.Generator.Element) -> U
) -> U {
fatalError("unavailable function can't be called")
}

View File

@@ -169,9 +169,6 @@ ${SelfDocComment}
public struct ${Self}<Element> public struct ${Self}<Element>
: CollectionType, MutableCollectionType, _DestructorSafeContainer { : CollectionType, MutableCollectionType, _DestructorSafeContainer {
@available(*, unavailable, renamed="Element")
public typealias T = Element
%if Self == 'ArraySlice': %if Self == 'ArraySlice':
/// The position of the first element in a non-empty collection. /// The position of the first element in a non-empty collection.
/// ///
@@ -765,17 +762,6 @@ extension ${Self} : _ArrayType {
} }
} }
/// Returns a copy of `self` that has been sorted according to
/// `isOrderedBefore`.
///
/// - Requires: `isOrderedBefore` induces a
/// [strict weak ordering](http://en.wikipedia.org/wiki/Strict_weak_order#Strict_weak_orderings)
/// over the elements.
@available(*, unavailable, message="call the 'sort()' method on the array")
public func sorted(isOrderedBefore: (Element, Element) -> Bool) -> ${Self} {
fatalError("unavailable function can't be called")
}
@warn_unused_result @warn_unused_result
public func _copyToNativeArrayBuffer() -> _ContiguousArrayBuffer<Element> { public func _copyToNativeArrayBuffer() -> _ContiguousArrayBuffer<Element> {
return _extractOrCopyToNativeArrayBuffer(self._buffer) return _extractOrCopyToNativeArrayBuffer(self._buffer)

View File

@@ -341,9 +341,6 @@ internal var _nilNativeObject: AnyObject? {
public struct AutoreleasingUnsafeMutablePointer<Memory /* TODO : class */> public struct AutoreleasingUnsafeMutablePointer<Memory /* TODO : class */>
: Equatable, NilLiteralConvertible, _PointerType { : Equatable, NilLiteralConvertible, _PointerType {
@available(*, unavailable, renamed="Memory")
public typealias T = Memory
public let _rawValue: Builtin.RawPointer public let _rawValue: Builtin.RawPointer
@_transparent @_transparent

View File

@@ -154,13 +154,6 @@ public func ==(lhs: COpaquePointer, rhs: COpaquePointer) -> Bool {
return Bool(Builtin.cmp_eq_RawPointer(lhs._rawValue, rhs._rawValue)) return Bool(Builtin.cmp_eq_RawPointer(lhs._rawValue, rhs._rawValue))
} }
/// The family of C function pointer types.
///
/// This type has been removed. Instead of `CFunctionType<(T) -> U>`, a native
/// function type with the C convention can be used, `@convention(c) (T) -> U`.
@available(*, unavailable, message="use a function type '@convention(c) (T) -> U'")
public struct CFunctionPointer<T> {}
/// The corresponding Swift type to `va_list` in imported C APIs. /// The corresponding Swift type to `va_list` in imported C APIs.
public struct CVaListPointer { public struct CVaListPointer {
var value: UnsafeMutablePointer<Void> var value: UnsafeMutablePointer<Void>

View File

@@ -10,11 +10,6 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
@available(*, unavailable, message="access the 'count' property on the collection")
public func count <T : CollectionType>(x: T) -> T.Index.Distance {
fatalError("unavailable function can't be called")
}
/// A protocol representing the minimal requirements of /// A protocol representing the minimal requirements of
/// `CollectionType`. /// `CollectionType`.
/// ///
@@ -606,26 +601,6 @@ extension CollectionType {
} }
} }
/// Returns `true` iff `x` is empty.
@available(*, unavailable, message="access the 'isEmpty' property on the collection")
public func isEmpty<C: CollectionType>(x: C) -> Bool {
fatalError("unavailable function can't be called")
}
/// Returns the first element of `x`, or `nil` if `x` is empty.
@available(*, unavailable, message="access the 'first' property on the collection")
public func first<C: CollectionType>(x: C) -> C.Generator.Element? {
fatalError("unavailable function can't be called")
}
/// Returns the last element of `x`, or `nil` if `x` is empty.
@available(*, unavailable, message="access the 'last' property on the collection")
public func last<C: CollectionType where C.Index: BidirectionalIndexType>(
x: C
) -> C.Generator.Element? {
fatalError("unavailable function can't be called")
}
/// A *collection* that supports subscript assignment. /// A *collection* that supports subscript assignment.
/// ///
/// For any instance `a` of a type conforming to /// For any instance `a` of a type conforming to
@@ -736,17 +711,6 @@ internal func _writeBackMutableSlice<
"Can not replace a slice of a MutableCollectionType with a slice of a smaller size") "Can not replace a slice of a MutableCollectionType with a slice of a smaller size")
} }
/// Returns the range of `x`'s valid index values.
///
/// The result's `endIndex` is the same as that of `x`. Because
/// `Range` is half-open, iterating the values of the result produces
/// all valid subscript arguments for `x`, omitting its `endIndex`.
@available(*, unavailable, message="access the 'indices' property on the collection")
public func indices<
C : CollectionType>(x: C) -> Range<C.Index> {
fatalError("unavailable function can't be called")
}
/// A *generator* that adapts a *collection* `C` and any *sequence* of /// A *generator* that adapts a *collection* `C` and any *sequence* of
/// its `Index` type to present the collection's elements in a /// its `Index` type to present the collection's elements in a
/// permuted order. /// permuted order.
@@ -789,31 +753,3 @@ public protocol MutableSliceable : CollectionType, MutableCollectionType {
subscript(_: Range<Index>) -> SubSequence { get set } subscript(_: Range<Index>) -> SubSequence { get set }
} }
@available(*, unavailable, message="Use the dropFirst() method instead.")
public func dropFirst<Seq : CollectionType>(s: Seq) -> Seq.SubSequence {
fatalError("unavailable function can't be called")
}
@available(*, unavailable, message="Use the dropLast() method instead.")
public func dropLast<
S : CollectionType
where S.Index: BidirectionalIndexType
>(s: S) -> S.SubSequence {
fatalError("unavailable function can't be called")
}
@available(*, unavailable, message="Use the prefix() method.")
public func prefix<S : CollectionType>(s: S, _ maxLength: Int) -> S.SubSequence {
fatalError("unavailable function can't be called")
}
@available(*, unavailable, message="Use the suffix() method instead.")
public func suffix<
S : CollectionType where S.Index: BidirectionalIndexType
>(s: S, _ maxLength: Int) -> S.SubSequence {
fatalError("unavailable function can't be called")
}
@available(*, unavailable, renamed="CollectionType")
public struct Sliceable {}

View File

@@ -12,9 +12,6 @@
/// A generator that produces one or fewer instances of `Element`. /// A generator that produces one or fewer instances of `Element`.
public struct GeneratorOfOne<Element> : GeneratorType, SequenceType { public struct GeneratorOfOne<Element> : GeneratorType, SequenceType {
@available(*, unavailable, renamed="Element")
public typealias T = Element
/// Construct an instance that generates `element!`, or an empty /// Construct an instance that generates `element!`, or an empty
/// sequence if `element == nil`. /// sequence if `element == nil`.
public init(_ element: Element?) { public init(_ element: Element?) {
@@ -37,9 +34,6 @@ public struct GeneratorOfOne<Element> : GeneratorType, SequenceType {
/// A collection containing a single element of type `Element`. /// A collection containing a single element of type `Element`.
public struct CollectionOfOne<Element> : CollectionType { public struct CollectionOfOne<Element> : CollectionType {
@available(*, unavailable, renamed="Element")
public typealias T = Element
/// A type that represents a valid position in the collection. /// A type that represents a valid position in the collection.
/// ///
/// Valid indices consist of the position of every element and a /// Valid indices consist of the position of every element and a

View File

@@ -21,9 +21,6 @@
/// ///
/// - SeeAlso: `EmptyCollection<Element>`. /// - SeeAlso: `EmptyCollection<Element>`.
public struct EmptyGenerator<Element> : GeneratorType, SequenceType { public struct EmptyGenerator<Element> : GeneratorType, SequenceType {
@available(*, unavailable, renamed="Element")
public typealias T = Element
/// Construct an instance. /// Construct an instance.
public init() {} public init() {}
@@ -35,9 +32,6 @@ public struct EmptyGenerator<Element> : GeneratorType, SequenceType {
/// A collection whose element type is `Element` but that is always empty. /// A collection whose element type is `Element` but that is always empty.
public struct EmptyCollection<Element> : CollectionType { public struct EmptyCollection<Element> : CollectionType {
@available(*, unavailable, renamed="Element")
public typealias T = Element
/// A type that represents a valid position in the collection. /// A type that represents a valid position in the collection.
/// ///
/// Valid indices consist of the position of every element and a /// Valid indices consist of the position of every element and a

View File

@@ -18,14 +18,6 @@
// Policy.swift. Similar components should usually be defined next to // Policy.swift. Similar components should usually be defined next to
// their respective protocols. // their respective protocols.
/// Unavailable; use `AnyGenerator<T>` instead.
@available(*, unavailable, renamed="AnyGenerator")
public struct GeneratorOf<T> {}
/// Unavailable; use `AnySequence<T>` instead.
@available(*, unavailable, renamed="AnySequence")
public struct SequenceOf<T> {}
internal struct _CollectionOf< internal struct _CollectionOf<
IndexType_ : ForwardIndexType, T IndexType_ : ForwardIndexType, T
> : CollectionType { > : CollectionType {
@@ -61,6 +53,3 @@ internal struct _CollectionOf<
let _subscriptImpl: (IndexType_)->T let _subscriptImpl: (IndexType_)->T
} }
@available(*, unavailable, message="SinkOf has been removed. Use (T)->() closures directly instead.")
public struct SinkOf<T> {}

View File

@@ -31,9 +31,6 @@ internal func _abstract(file: StaticString = __FILE__, line: UInt = __LINE__) {
/// - seealso: /// - seealso:
/// - `struct AnySequence<S : SequenceType>` /// - `struct AnySequence<S : SequenceType>`
public struct AnyGenerator<Element> : GeneratorType { public struct AnyGenerator<Element> : GeneratorType {
@available(*, unavailable, renamed="Element")
public typealias T = Element
/// Create a `GeneratorType` instance that wraps `base` but whose type /// Create a `GeneratorType` instance that wraps `base` but whose type
/// depends only on the type of `G.Element`. /// depends only on the type of `G.Element`.
/// ///
@@ -81,16 +78,6 @@ public struct AnyGenerator<Element> : GeneratorType {
/// traversing the sequence consumes the generator. /// traversing the sequence consumes the generator.
extension AnyGenerator : SequenceType {} extension AnyGenerator : SequenceType {}
@available(*, unavailable, renamed="AnyGenerator")
public func anyGenerator<G: GeneratorType>(base: G) -> AnyGenerator<G.Element> {
fatalError("unavailable function can't be called")
}
@available(*, unavailable, renamed="AnyGenerator")
public func anyGenerator<Element>(body: ()->Element?) -> AnyGenerator<Element> {
fatalError("unavailable function can't be called")
}
internal struct _ClosureBasedGenerator<Element> : GeneratorType { internal struct _ClosureBasedGenerator<Element> : GeneratorType {
internal init(_ body: () -> Element?) { internal init(_ body: () -> Element?) {
self._body = body self._body = body
@@ -220,9 +207,6 @@ internal struct _ClosureBasedSequence<Generator : GeneratorType>
/// ///
/// - SeeAlso: `AnyGenerator<Element>`. /// - SeeAlso: `AnyGenerator<Element>`.
public struct AnySequence<Element> : SequenceType { public struct AnySequence<Element> : SequenceType {
@available(*, unavailable, renamed="Element")
public typealias T = Element
/// Wrap and forward operations to to `base`. /// Wrap and forward operations to to `base`.
public init<S: SequenceType where S.Generator.Element == Element>(_ base: S) { public init<S: SequenceType where S.Generator.Element == Element>(_ base: S) {
_box = _SequenceBox(base) _box = _SequenceBox(base)
@@ -549,9 +533,6 @@ public func !== <
/// ///
/// - SeeAlso: ${', '.join('`Any%sType`' % t for t in (2 * traversals)[ti + 1 : ti + 3]) } /// - SeeAlso: ${', '.join('`Any%sType`' % t for t in (2 * traversals)[ti + 1 : ti + 3]) }
public struct Any${Traversal}Collection<Element> : AnyCollectionType { public struct Any${Traversal}Collection<Element> : AnyCollectionType {
@available(*, unavailable, renamed="Element")
public typealias T = Element
typealias Box = _AnyCollectionBox<Element> typealias Box = _AnyCollectionBox<Element>
% for SubTraversal in traversals[ti:]: % for SubTraversal in traversals[ti:]:

View File

@@ -132,9 +132,6 @@ public struct LazyFilterIndex<
/// The predicate used to determine which elements of `base` are /// The predicate used to determine which elements of `base` are
/// also elements of `self`. /// also elements of `self`.
internal let _include: (BaseElements.Generator.Element)->Bool internal let _include: (BaseElements.Generator.Element)->Bool
@available(*, unavailable, renamed="BaseElements")
public typealias Base = BaseElements
} }
/// Returns `true` iff `lhs` is identical to `rhs`. /// Returns `true` iff `lhs` is identical to `rhs`.
@@ -257,24 +254,6 @@ extension LazyCollectionType {
} }
} }
/// Return an `Array` containing the elements of `source`,
/// in order, that satisfy the predicate `includeElement`.
@available(*, unavailable, message="call the 'filter()' method on the sequence")
public func filter<S : SequenceType>(
source: S, _ includeElement: (S.Generator.Element) -> Bool
) -> [S.Generator.Element] {
fatalError("unavailable function can't be called")
}
@available(*, unavailable, renamed="FilterSequence")
public struct FilterSequenceView<Base : SequenceType> {}
@available(*, unavailable, renamed="FilterCollectionIndex")
public struct FilterCollectionViewIndex<Base: CollectionType> {}
@available(*, unavailable, renamed="FilterCollection")
public struct FilterCollectionView<Base : CollectionType> {}
// ${'Local Variables'}: // ${'Local Variables'}:
// eval: (read-only-mode 1) // eval: (read-only-mode 1)
// End: // End:

View File

@@ -655,12 +655,6 @@ public func _leadingZeros(x: Builtin.Int${bits}) -> Builtin.Int${bits} {
//===--- End loop over all integer types ----------------------------------===// //===--- End loop over all integer types ----------------------------------===//
@available(*, unavailable, renamed="Int")
public typealias Word = Int
@available(*, unavailable, renamed="UInt")
public typealias UWord = UInt
// ${'Local Variables'}: // ${'Local Variables'}:
// eval: (read-only-mode 1) // eval: (read-only-mode 1)
// End: // End:

View File

@@ -279,9 +279,6 @@ internal struct _UnmanagedAnyObjectArray {
public struct Set<Element : Hashable> : public struct Set<Element : Hashable> :
Hashable, CollectionType, ArrayLiteralConvertible { Hashable, CollectionType, ArrayLiteralConvertible {
@available(*, unavailable, renamed="Element")
public typealias T = Element
internal typealias _Self = Set<Element> internal typealias _Self = Set<Element>
internal typealias _VariantStorage = _VariantSetStorage<Element> internal typealias _VariantStorage = _VariantSetStorage<Element>
internal typealias _NativeStorage = _NativeSetStorage<Element> internal typealias _NativeStorage = _NativeSetStorage<Element>
@@ -3652,9 +3649,6 @@ public struct ${Self}Index<${TypeParametersDecl}> :
%if Self == 'Set': %if Self == 'Set':
internal typealias Key = ${TypeParameters} internal typealias Key = ${TypeParameters}
internal typealias Value = ${TypeParameters} internal typealias Value = ${TypeParameters}
@available(*, unavailable, renamed="Element")
public typealias T = Element
%end %end
internal var _value: ${Self}IndexRepresentation<${TypeParameters}> internal var _value: ${Self}IndexRepresentation<${TypeParameters}>
@@ -3874,11 +3868,6 @@ public struct ${Self}Generator<${TypeParametersDecl}> : GeneratorType {
_Native${Self}StorageOwner<${TypeParameters}> _Native${Self}StorageOwner<${TypeParameters}>
internal typealias _NativeIndex = _Native${Self}Index<${TypeParameters}> internal typealias _NativeIndex = _Native${Self}Index<${TypeParameters}>
%if Self == 'Set':
@available(*, unavailable, renamed="Element")
public typealias T = Element
%end
internal var _state: ${Self}GeneratorRepresentation<${TypeParameters}> internal var _state: ${Self}GeneratorRepresentation<${TypeParameters}>
internal static func _Native( internal static func _Native(

View File

@@ -21,9 +21,6 @@ public enum ImplicitlyUnwrappedOptional<Wrapped>
case None case None
case Some(Wrapped) case Some(Wrapped)
@available(*, unavailable, renamed="Wrapped")
public typealias T = Wrapped
/// Construct a `nil` instance. /// Construct a `nil` instance.
public init() { self = .None } public init() { self = .None }

View File

@@ -14,26 +14,6 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
//===----------------------------------------------------------------------===//
//===--- Dispatching advance and distance functions -----------------------===//
// These generic functions are for user consumption; they dispatch to the
// appropriate implementation for T.
@available(*, unavailable, message="call the 'distanceTo(end)' method on the index")
public func distance<T : ForwardIndexType>(start: T, _ end: T) -> T.Distance {
fatalError("unavailable function can't be called")
}
@available(*, unavailable, message="call the 'advancedBy(n)' method on the index")
public func advance<T : ForwardIndexType>(start: T, _ n: T.Distance) -> T {
fatalError("unavailable function can't be called")
}
@available(*, unavailable, message="call the 'advancedBy(n, limit:)' method on the index")
public func advance<T : ForwardIndexType>(start: T, _ n: T.Distance, _ end: T) -> T {
fatalError("unavailable function can't be called")
}
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
//===--- ForwardIndexType -------------------------------------------------===// //===--- ForwardIndexType -------------------------------------------------===//

View File

@@ -60,9 +60,6 @@ ${selfDocComment}
public struct ${Self}<Bound : Comparable> public struct ${Self}<Bound : Comparable>
: IntervalType, Equatable, CustomStringConvertible, CustomDebugStringConvertible, _Reflectable { : IntervalType, Equatable, CustomStringConvertible, CustomDebugStringConvertible, _Reflectable {
@available(*, unavailable, renamed="Bound")
public typealias T = Bound
/// Construct a copy of `x`. /// Construct a copy of `x`.
public init(_ x: ${Self}) { public init(_ x: ${Self}) {
// This initializer exists only so that we can have a descriptive // This initializer exists only so that we can have a descriptive
@@ -171,13 +168,6 @@ extension IntervalType {
} }
} }
@available(*, unavailable, message="call the 'overlaps(other)' method on the interval")
public func overlaps<
I0: IntervalType, I1: IntervalType where I0.Bound == I1.Bound
>(lhs: I0, _ rhs: I1) -> Bool {
fatalError("unavailable function can't be called")
}
/// Returns a half-open interval from `start` to `end`. /// Returns a half-open interval from `start` to `end`.
@warn_unused_result @warn_unused_result
public func ..< <Bound : Comparable>( public func ..< <Bound : Comparable>(

View File

@@ -180,13 +180,3 @@ extension SequenceType where Generator.Element : SequenceType {
} }
} }
@available(*, unavailable, message="call the 'joinWithSeparator()' method on the sequence of elements")
public func join<
C : RangeReplaceableCollectionType, S : SequenceType
where S.Generator.Element == C
>(
separator: C, _ elements: S
) -> C {
fatalError("unavailable function can't be called")
}

View File

@@ -163,9 +163,6 @@ extension LazyCollection : CollectionType {
public var first: Base.Generator.Element? { public var first: Base.Generator.Element? {
return _base.first return _base.first
} }
@available(*, unavailable, renamed="Base")
public typealias S = Void
} }
/// Augment `self` with lazy methods such as `map`, `filter`, etc. /// Augment `self` with lazy methods such as `map`, `filter`, etc.
@@ -187,18 +184,6 @@ extension LazyCollectionType {
} }
} }
@available(*, unavailable, message="Please use the collection's '.lazy' property")
public func lazy<Base : CollectionType>(s: Base) -> LazyCollection<Base> {
fatalError("unavailable")
}
@available(*, unavailable, renamed="LazyCollection")
public struct LazyForwardCollection<T> {}
@available(*, unavailable, renamed="LazyCollection")
public struct LazyBidirectionalCollection<T> {}
@available(*, unavailable, renamed="LazyCollection")
public struct LazyRandomAccessCollection<T> {}
// ${'Local Variables'}: // ${'Local Variables'}:
// eval: (read-only-mode 1) // eval: (read-only-mode 1)
// End: // End:

View File

@@ -147,13 +147,6 @@ public protocol LazySequenceType : SequenceType {
/// it has a default implementation in a protocol extension that /// it has a default implementation in a protocol extension that
/// just returns `self`. /// just returns `self`.
var elements: Elements {get} var elements: Elements {get}
var array: [Generator.Element] {get}
}
extension LazySequenceType {
@available(*, unavailable, message="please construct an Array from your lazy sequence: Array(...)")
public var array: [Generator.Element] { fatalError("unavailable") }
} }
/// When there's no special associated `Elements` type, the `elements` /// When there's no special associated `Elements` type, the `elements`
@@ -182,9 +175,6 @@ public struct LazySequence<Base : SequenceType>
/// The `Base` (presumably non-lazy) sequence from which `self` was created. /// The `Base` (presumably non-lazy) sequence from which `self` was created.
public var elements: Base { return _base } public var elements: Base { return _base }
@available(*, unavailable, renamed="Base")
public typealias S = Void
} }
extension SequenceType { extension SequenceType {
@@ -207,8 +197,3 @@ extension LazySequenceType {
} }
} }
@available(*, unavailable, message="Please use the sequence's '.lazy' property")
public func lazy<Base : SequenceType>(s: Base) -> LazySequence<Base> {
fatalError("unavailable")
}

View File

@@ -16,9 +16,6 @@
public struct LazyMapGenerator< public struct LazyMapGenerator<
Base : GeneratorType, Element Base : GeneratorType, Element
> : GeneratorType, SequenceType { > : GeneratorType, SequenceType {
@available(*, unavailable, renamed="Element")
public typealias T = Element
/// Advance to the next element and return it, or `nil` if no next /// Advance to the next element and return it, or `nil` if no next
/// element exists. /// element exists.
/// ///
@@ -72,9 +69,6 @@ public struct LazyMapSequence<Base : SequenceType, Element>
public var _base: Base public var _base: Base
internal var _transform: (Base.Generator.Element)->Element internal var _transform: (Base.Generator.Element)->Element
@available(*, unavailable, renamed="Element")
public typealias T = Element
} }
//===--- Collections ------------------------------------------------------===// //===--- Collections ------------------------------------------------------===//
@@ -134,9 +128,6 @@ public struct LazyMapCollection<Base : CollectionType, Element>
public var _base: Base public var _base: Base
var _transform: (Base.Generator.Element)->Element var _transform: (Base.Generator.Element)->Element
@available(*, unavailable, renamed="Element")
public typealias T = Element
} }
//===--- Support for s.lazy ----------------------------------------------===// //===--- Support for s.lazy ----------------------------------------------===//
@@ -165,33 +156,6 @@ extension LazyCollectionType {
} }
} }
/// Return an `Array` containing the results of mapping `transform`
/// over `source`.
@available(*, unavailable, message="call the 'map()' method on the sequence")
public func map<C : CollectionType, T>(
source: C, _ transform: (C.Generator.Element) -> T
) -> [T] {
fatalError("unavailable function can't be called")
}
/// Return an `Array` containing the results of mapping `transform`
/// over `source` and flattening the result.
@available(*, unavailable, message="call the 'flatMap()' method on the sequence")
public func flatMap<C : CollectionType, T>(
source: C, _ transform: (C.Generator.Element) -> [T]
) -> [T] {
fatalError("unavailable function can't be called")
}
@available(*, unavailable, renamed="LazyMapGenerator")
public struct MapSequenceGenerator<Base : GeneratorType, T> {}
@available(*, unavailable, renamed="LazyMapSequence")
public struct MapSequenceView<Base : SequenceType, T> {}
@available(*, unavailable, renamed="LazyMapCollection")
public struct MapCollectionView<Base : CollectionType, T> {}
// ${'Local Variables'}: // ${'Local Variables'}:
// eval: (read-only-mode 1) // eval: (read-only-mode 1)
// End: // End:

View File

@@ -823,6 +823,3 @@ extension Mirror : CustomReflectable {
} }
} }
@available(*, unavailable, renamed="PlaygroundQuickLook")
public typealias QuickLookObject = PlaygroundQuickLook

View File

@@ -162,5 +162,3 @@ extension OptionSetType where RawValue : BitwiseOperationsType {
} }
} }
@available(*, unavailable, renamed="OptionSetType")
public typealias RawOptionSetType = OptionSetType

View File

@@ -16,9 +16,6 @@ public enum Optional<Wrapped> : _Reflectable, NilLiteralConvertible {
case None case None
case Some(Wrapped) case Some(Wrapped)
@available(*, unavailable, renamed="Wrapped")
public typealias T = Wrapped
/// Construct a `nil` instance. /// Construct a `nil` instance.
@_transparent @_transparent
public init() { self = .None } public init() { self = .None }
@@ -77,26 +74,6 @@ extension Optional : CustomDebugStringConvertible {
} }
} }
// While this free function may seem obsolete, since an optional is
// often expressed as (x as Wrapped), it can lead to cleaner usage, i.e.
//
// map(x as Wrapped) { ... }
// vs
// (x as Wrapped).map { ... }
//
/// Haskell's fmap for Optionals.
@available(*, unavailable, message="call the 'map()' method on the optional value")
public func map<T, U>(x: T?, @noescape _ f: (T)->U) -> U? {
fatalError("unavailable function can't be called")
}
/// Returns `f(self)!` iff `self` and `f(self)` are not nil.
@available(*, unavailable, message="call the 'flatMap()' method on the optional value")
public func flatMap<T, U>(x: T?, @noescape _ f: (T)->U?) -> U? {
fatalError("unavailable function can't be called")
}
// Intrinsics for use by language features. // Intrinsics for use by language features.
@_transparent @_transparent
public // COMPILER_INTRINSIC public // COMPILER_INTRINSIC

View File

@@ -283,55 +283,6 @@ extension UnicodeScalar : Streamable {
} }
} }
//===----------------------------------------------------------------------===//
// Unavailable APIs
//===----------------------------------------------------------------------===//
@available(*, unavailable, renamed="CustomDebugStringConvertible")
public typealias DebugPrintable = CustomDebugStringConvertible
@available(*, unavailable, renamed="CustomStringConvertible")
public typealias Printable = CustomStringConvertible
@available(*, unavailable, renamed="print")
public func println<T, TargetStream : OutputStreamType>(
value: T, inout _ target: TargetStream
) {
fatalError("unavailable function can't be called")
}
@available(*, unavailable, renamed="print")
public func println<T>(value: T) {
fatalError("unavailable function can't be called")
}
@available(*, unavailable, message="use print(\"\")")
public func println() {
fatalError("unavailable function can't be called")
}
@available(*, unavailable, renamed="String")
public func toString<T>(x: T) -> String {
fatalError("unavailable function can't be called")
}
@available(*, unavailable, message="use debugPrint()")
public func debugPrintln<T, TargetStream : OutputStreamType>(
x: T, inout _ target: TargetStream
) {
fatalError("unavailable function can't be called")
}
@available(*, unavailable, renamed="debugPrint")
public func debugPrintln<T>(x: T) {
fatalError("unavailable function can't be called")
}
/// Returns the result of `debugPrint`'ing `x` into a `String`.
@available(*, unavailable, message="use String(reflecting:)")
public func toDebugString<T>(x: T) -> String {
fatalError("unavailable function can't be called")
}
/// A hook for playgrounds to print through. /// A hook for playgrounds to print through.
public var _playgroundPrintHook : ((String)->Void)? = {_ in () } public var _playgroundPrintHook : ((String)->Void)? = {_ in () }

View File

@@ -326,10 +326,6 @@ public protocol Hashable : Equatable {
var hashValue: Int { get } var hashValue: Int { get }
} }
public protocol _SinkType {}
@available(*, unavailable, message="SinkType has been removed. Use (T)->() closures directly instead.")
public typealias SinkType = _SinkType
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// Standard pattern matching forms // Standard pattern matching forms
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//

View File

@@ -159,11 +159,6 @@ public func print<T>(_: T) {}
@available(*, unavailable, message="Please wrap your tuple argument in parentheses: 'debugPrint((...))'") @available(*, unavailable, message="Please wrap your tuple argument in parentheses: 'debugPrint((...))'")
public func debugPrint<T>(_: T) {} public func debugPrint<T>(_: T) {}
@available(*, unavailable, message="Please use 'terminator: \"\"' instead of 'appendNewline: false': 'print((...), terminator: \"\")'")
public func print<T>(_: T, appendNewline: Bool) {}
@available(*, unavailable, message="Please use 'terminator: \"\"' instead of 'appendNewline: false': 'debugPrint((...), terminator: \"\")'")
public func debugPrint<T>(_: T, appendNewline: Bool) {}
//===--- FIXME: Not working due to <rdar://22101775> ----------------------===// //===--- FIXME: Not working due to <rdar://22101775> ----------------------===//
@available(*, unavailable, message="Please use the 'toStream' label for the target stream: 'print((...), toStream: &...)'") @available(*, unavailable, message="Please use the 'toStream' label for the target stream: 'print((...), toStream: &...)'")
@@ -171,11 +166,5 @@ public func print<T>(_: T, inout _: OutputStreamType) {}
@available(*, unavailable, message="Please use the 'toStream' label for the target stream: 'debugPrint((...), toStream: &...))'") @available(*, unavailable, message="Please use the 'toStream' label for the target stream: 'debugPrint((...), toStream: &...))'")
public func debugPrint<T>(_: T, inout _: OutputStreamType) {} public func debugPrint<T>(_: T, inout _: OutputStreamType) {}
@available(*, unavailable, message="Please use 'terminator: \"\"' instead of 'appendNewline: false' and use the 'toStream' label for the target stream: 'print((...), terminator: \"\", toStream: &...)'")
public func print<T>(_: T, inout _: OutputStreamType, appendNewline: Bool) {}
@available(*, unavailable, message="Please use 'terminator: \"\"' instead of 'appendNewline: false' and use the 'toStream' label for the target stream: 'debugPrint((...), terminator: \"\", toStream: &...)'")
public func debugPrint<T>(
_: T, inout _: OutputStreamType, appendNewline: Bool
) {}
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//

View File

@@ -15,9 +15,6 @@ public struct RangeGenerator<
Element : ForwardIndexType Element : ForwardIndexType
> : GeneratorType, SequenceType { > : GeneratorType, SequenceType {
@available(*, unavailable, renamed="Element")
public typealias T = Element
/// Construct an instance that traverses the elements of `bounds`. /// Construct an instance that traverses the elements of `bounds`.
@_transparent @_transparent
public init(_ bounds: Range<Element>) { public init(_ bounds: Range<Element>) {
@@ -75,9 +72,6 @@ public struct Range<
> : Equatable, CollectionType, > : Equatable, CollectionType,
CustomStringConvertible, CustomDebugStringConvertible { CustomStringConvertible, CustomDebugStringConvertible {
@available(*, unavailable, renamed="Element")
public typealias T = Element
/// Construct a copy of `x`. /// Construct a copy of `x`.
public init(_ x: Range) { public init(_ x: Range) {
// This initializer exists only so that we can have a // This initializer exists only so that we can have a

View File

@@ -337,109 +337,6 @@ extension RangeReplaceableCollectionType where Index : BidirectionalIndexType {
} }
} }
/// Insert `newElement` into `x` at index `i`.
///
/// Invalidates all indices with respect to `x`.
///
/// - Complexity: O(`x.count`).
@available(*, unavailable, message="call the 'insert()' method on the collection")
public func insert<
C: RangeReplaceableCollectionType
>(inout x: C, _ newElement: C.Generator.Element, atIndex i: C.Index) {
fatalError("unavailable function can't be called")
}
/// Insert `newElements` into `x` at index `i`.
///
/// Invalidates all indices with respect to `x`.
///
/// - Complexity: O(`x.count + newElements.count`).
@available(*, unavailable, message="call the 'insertContentsOf()' method on the collection")
public func splice<
C: RangeReplaceableCollectionType,
S : CollectionType where S.Generator.Element == C.Generator.Element
>(inout x: C, _ newElements: S, atIndex i: C.Index) {
fatalError("unavailable function can't be called")
}
/// Remove from `x` and return the element at index `i`.
///
/// Invalidates all indices with respect to `x`.
///
/// - Complexity: O(`x.count`).
@available(*, unavailable, message="call the 'removeAtIndex()' method on the collection")
public func removeAtIndex<
C: RangeReplaceableCollectionType
>(inout x: C, _ index: C.Index) -> C.Generator.Element {
fatalError("unavailable function can't be called")
}
/// Remove from `x` the indicated `subRange` of elements.
///
/// Invalidates all indices with respect to `x`.
///
/// - Complexity: O(`x.count`).
@available(*, unavailable, message="call the 'removeRange()' method on the collection")
public func removeRange<
C: RangeReplaceableCollectionType
>(inout x: C, _ subRange: Range<C.Index>) {
fatalError("unavailable function can't be called")
}
/// Remove all elements from `x`.
///
/// Invalidates all indices with respect to `x`.
///
/// - parameter keepCapacity: If `true`, is a non-binding request to
/// avoid releasing storage, which can be a useful optimization
/// when `x` is going to be grown again.
///
/// - Complexity: O(`x.count`).
@available(*, unavailable, message="call the 'removeAll()' method on the collection")
public func removeAll<
C: RangeReplaceableCollectionType
>(inout x: C, keepCapacity: Bool = false) {
fatalError("unavailable function can't be called")
}
/// Append elements from `newElements` to `x`.
///
/// - Complexity: O(N).
@available(*, unavailable, message="call the 'appendContentsOf()' method on the collection")
public func extend<
C: RangeReplaceableCollectionType,
S : SequenceType where S.Generator.Element == C.Generator.Element
>(inout x: C, _ newElements: S) {
fatalError("unavailable function can't be called")
}
extension RangeReplaceableCollectionType {
@available(*, unavailable, renamed="appendContentsOf")
public mutating func extend<
S : SequenceType
where S.Generator.Element == Generator.Element
>(newElements: S) {
fatalError("unavailable function can't be called")
}
@available(*, unavailable, renamed="insertContentsOf")
public mutating func splice<
S : CollectionType where S.Generator.Element == Generator.Element
>(newElements: S, atIndex i: Index) {
fatalError("unavailable function can't be called")
}
}
/// Remove an element from the end of `x` in O(1).
///
/// - Requires: `x` is nonempty.
@available(*, unavailable, message="call the 'removeLast()' method on the collection")
public func removeLast<
C: RangeReplaceableCollectionType where C.Index : BidirectionalIndexType
>(inout x: C) -> C.Generator.Element {
fatalError("unavailable function can't be called")
}
@warn_unused_result @warn_unused_result
public func +< public func +<
C : RangeReplaceableCollectionType, C : RangeReplaceableCollectionType,
@@ -491,5 +388,3 @@ public func +<
return lhs return lhs
} }
@available(*, unavailable, renamed="RangeReplaceableCollectionType")
public typealias ExtensibleCollectionType = RangeReplaceableCollectionType

View File

@@ -473,8 +473,3 @@ struct _MetatypeMirror : _MirrorType {
var disposition: _MirrorDisposition { return .Aggregate } var disposition: _MirrorDisposition { return .Aggregate }
} }
@available(*, unavailable, message="call the 'Mirror(reflecting:)' initializer")
public func reflect<T>(x: T) -> _MirrorType {
fatalError("unavailable function can't be called")
}

View File

@@ -12,10 +12,6 @@
/// A collection whose elements are all identical `Element`s. /// A collection whose elements are all identical `Element`s.
public struct Repeat<Element> : CollectionType { public struct Repeat<Element> : CollectionType {
@available(*, unavailable, renamed="Element")
public typealias T = Element
/// A type that represents a valid position in the collection. /// A type that represents a valid position in the collection.
/// ///
/// Valid indices consist of the position of every element and a /// Valid indices consist of the position of every element and a

View File

@@ -61,9 +61,6 @@ public struct ReverseIndex<Base: BidirectionalIndexType>
/// - if `n` != `c.count`, then `c.reverse[self]` is /// - if `n` != `c.count`, then `c.reverse[self]` is
/// equivalent to `[self.base.predecessor()]`. /// equivalent to `[self.base.predecessor()]`.
public let base: Base public let base: Base
@available(*, unavailable, renamed="Base")
public typealias I = Base
} }
@warn_unused_result @warn_unused_result
@@ -98,9 +95,6 @@ public struct ReverseRandomAccessIndex<Base: RandomAccessIndexType>
public func advancedBy(n: Distance) -> ReverseRandomAccessIndex { public func advancedBy(n: Distance) -> ReverseRandomAccessIndex {
return ReverseRandomAccessIndex(base.advancedBy(-n)) return ReverseRandomAccessIndex(base.advancedBy(-n))
} }
@available(*, unavailable, renamed="Base")
public typealias I = Base
} }
public protocol _ReverseCollectionType : CollectionType { public protocol _ReverseCollectionType : CollectionType {
@@ -164,9 +158,6 @@ public struct ReverseCollection<
public typealias Generator = IndexingGenerator<ReverseCollection> public typealias Generator = IndexingGenerator<ReverseCollection>
public let _base: Base public let _base: Base
@available(*, unavailable, renamed="Base")
public typealias T = Base
} }
/// A Collection that presents the elements of its `Base` collection /// A Collection that presents the elements of its `Base` collection
@@ -199,9 +190,6 @@ public struct ReverseRandomAccessCollection<
> >
public let _base: Base public let _base: Base
@available(*, unavailable, renamed="Base")
public typealias T = Base
} }
extension CollectionType where Index : BidirectionalIndexType { extension CollectionType where Index : BidirectionalIndexType {
@@ -250,25 +238,6 @@ where Index : RandomAccessIndexType, Elements.Index : RandomAccessIndexType {
} }
} }
/// Return an `Array` containing the elements of `source` in reverse
/// order.
@available(*, unavailable, message="call the 'reverse()' method on the collection")
public func reverse<C:CollectionType where C.Index: BidirectionalIndexType>(
source: C
) -> [C.Generator.Element] {
fatalError("unavailable function can't be called")
}
@available(*, unavailable, renamed="ReverseCollection")
public struct BidirectionalReverseView<
Base : CollectionType where Base.Index : BidirectionalIndexType
> {}
@available(*, unavailable, renamed="ReverseRandomAccessCollection")
public struct RandomAccessReverseView<
Base : CollectionType where Base.Index : RandomAccessIndexType
> {}
// ${'Local Variables'}: // ${'Local Variables'}:
// eval: (read-only-mode 1) // eval: (read-only-mode 1)
// End: // End:

View File

@@ -602,14 +602,6 @@ extension SequenceType {
public func dropLast() -> SubSequence { return dropLast(1) } public func dropLast() -> SubSequence { return dropLast(1) }
} }
/// Return an underestimate of the number of elements in the given
/// sequence, without consuming the sequence. For Sequences that are
/// actually Collections, this will return `x.count`.
@available(*, unavailable, message="call the 'underestimateCount()' method on the sequence")
public func underestimateCount<T : SequenceType>(x: T) -> Int {
fatalError("unavailable function can't be called")
}
extension SequenceType { extension SequenceType {
public func _initializeTo(ptr: UnsafeMutablePointer<Generator.Element>) public func _initializeTo(ptr: UnsafeMutablePointer<Generator.Element>)
-> UnsafeMutablePointer<Generator.Element> { -> UnsafeMutablePointer<Generator.Element> {
@@ -632,10 +624,6 @@ extension SequenceType {
public struct GeneratorSequence< public struct GeneratorSequence<
Base : GeneratorType Base : GeneratorType
> : GeneratorType, SequenceType { > : GeneratorType, SequenceType {
@available(*, unavailable, renamed="Base")
public typealias G = Base
/// Construct an instance whose generator is a copy of `base`. /// Construct an instance whose generator is a copy of `base`.
public init(_ base: Base) { public init(_ base: Base) {
_base = base _base = base

View File

@@ -84,27 +84,6 @@ func _insertionSort<
} }
} }
/// Re-order the given `range` of `elements` and return a pivot index
/// *p*.
///
/// - Postcondition: For all *i* in `range.startIndex..<`*p*, and *j*
/// in *p*`..<range.endIndex`, `less(elements[`*i*`],
/// elements[`*j*`]) && !less(elements[`*j*`],
/// elements[`*p*`])`. Only returns `range.endIndex` when
/// `elements` is empty.
${orderingRequirement}
@available(*, unavailable, message="call the 'partition()' method on the collection")
public func partition<
C: MutableCollectionType where C.Index: RandomAccessIndexType
${"" if p else ", C.Generator.Element : Comparable"}
>(
inout elements: C,
_ range: Range<C.Index> ${"," if p else ""}
${"_ isOrderedBefore: (C.Generator.Element, C.Generator.Element)->Bool" if p else ""}
) -> C.Index {
fatalError("unavailable function can't be called")
}
func _partition< func _partition<
C: MutableCollectionType where C.Index: RandomAccessIndexType C: MutableCollectionType where C.Index: RandomAccessIndexType
${"" if p else ", C.Generator.Element : Comparable"} ${"" if p else ", C.Generator.Element : Comparable"}
@@ -280,81 +259,6 @@ func _heapSort<
} }
} }
%{
if p:
sortIsUnstable = """\
/// The sorting algorithm is not stable (can change the relative order of
/// elements for which `isOrderedBefore` does not establish an order)."""
else:
sortIsUnstable = """\
/// The sorting algorithm is not stable (can change the relative order of
/// elements that compare equal)."""
}%
/// Sort `collection` in-place${according}.
///
${sortIsUnstable}
///
${orderingRequirement}
@available(*, unavailable, message="call the 'sortInPlace()' method on the collection")
public func sort<
C: MutableCollectionType where C.Index: RandomAccessIndexType
${"" if p else ", C.Generator.Element : Comparable"}
>(
inout collection: C ${"," if p else ""}
${"_ isOrderedBefore: (C.Generator.Element, C.Generator.Element)->Bool" if p else ""}
) {
fatalError("unavailable function can't be called")
}
/// Sort `array` in-place${according}.
///
${sortIsUnstable}
///
${orderingRequirement}
% if p:
@available(*, unavailable, message="call the 'sortInPlace()' method on the collection")
public func sort<T>(inout array: [T], _ isOrderedBefore: (T, T) -> Bool) {
% else:
@available(*, unavailable, message="call the 'sortInPlace()' method on the collection")
public func sort<T : Comparable>(inout array: [T]) {
% end
fatalError("unavailable function can't be called")
}
/// Sort `array` in-place${according}.
///
${sortIsUnstable}
///
${orderingRequirement}
% if p:
@available(*, unavailable, message="call the 'sortInPlace()' method on the collection")
public func sort<T>(
inout array: ContiguousArray<T>,
_ isOrderedBefore: (T, T) -> Bool
) {
% else:
@available(*, unavailable, message="call the 'sortInPlace()' method on the collection")
public func sort<T : Comparable>(inout array: ContiguousArray<T>) {
% end
fatalError("unavailable function can't be called")
}
/// Return an `Array` containing the sorted elements of `source`${according}.
///
${sortIsUnstable}
///
${orderingRequirement}
@available(*, unavailable, message="call the 'sort()' method on the collection")
public func sorted<
C: SequenceType${"" if p else " where C.Generator.Element : Comparable"}
>(
source: C ${"," if p else ""}
${"_ isOrderedBefore: (C.Generator.Element, C.Generator.Element)->Bool" if p else ""}
) -> [C.Generator.Element] {
fatalError("unavailable function can't be called")
}
% end % end
// for p in preds // for p in preds

View File

@@ -122,9 +122,6 @@ public func -= <T : UnsignedIntegerType> (
/// A GeneratorType for `StrideTo<Element>`. /// A GeneratorType for `StrideTo<Element>`.
public struct StrideToGenerator<Element : Strideable> : GeneratorType { public struct StrideToGenerator<Element : Strideable> : GeneratorType {
@available(*, unavailable, renamed="Element")
public typealias T = Element
var current: Element var current: Element
let end: Element let end: Element
let stride: Element.Stride let stride: Element.Stride
@@ -145,9 +142,6 @@ public struct StrideToGenerator<Element : Strideable> : GeneratorType {
public struct StrideTo<Element : Strideable> : SequenceType { public struct StrideTo<Element : Strideable> : SequenceType {
// FIXME: should really be a CollectionType, as it is multipass // FIXME: should really be a CollectionType, as it is multipass
@available(*, unavailable, renamed="Element")
public typealias T = Element
/// Return a *generator* over the elements of this *sequence*. /// Return a *generator* over the elements of this *sequence*.
/// ///
/// - Complexity: O(1). /// - Complexity: O(1).
@@ -179,18 +173,8 @@ extension Strideable {
} }
} }
@available(*, unavailable, message="call the 'stride(to:by:)' method instead")
public func stride<
T : Strideable
>(from start: T, to end: T, by stride: T.Stride) -> StrideTo<T> {
fatalError("unavailable function can't be called")
}
/// A GeneratorType for `StrideThrough<Element>`. /// A GeneratorType for `StrideThrough<Element>`.
public struct StrideThroughGenerator<Element : Strideable> : GeneratorType { public struct StrideThroughGenerator<Element : Strideable> : GeneratorType {
@available(*, unavailable, renamed="Element")
public typealias T = Element
var current: Element var current: Element
let end: Element let end: Element
let stride: Element.Stride let stride: Element.Stride
@@ -219,9 +203,6 @@ public struct StrideThroughGenerator<Element : Strideable> : GeneratorType {
public struct StrideThrough<Element : Strideable> : SequenceType { public struct StrideThrough<Element : Strideable> : SequenceType {
// FIXME: should really be a CollectionType, as it is multipass // FIXME: should really be a CollectionType, as it is multipass
@available(*, unavailable, renamed="Element")
public typealias T = Element
/// Return a *generator* over the elements of this *sequence*. /// Return a *generator* over the elements of this *sequence*.
/// ///
/// - Complexity: O(1). /// - Complexity: O(1).
@@ -256,9 +237,3 @@ extension Strideable {
} }
} }
@available(*, unavailable, message="call the 'stride(through:by:)' method instead")
public func stride<
T : Strideable
>(from start: T, through end: T, by stride: T.Stride) -> StrideThrough<T> {
fatalError("unavailable function can't be called")
}

View File

@@ -606,15 +606,6 @@ extension String {
} }
} }
extension String {
@available(*, unavailable, message="call the 'joinWithSeparator()' method on the sequence of elements")
public func join<
S : SequenceType where S.Generator.Element == String
>(elements: S) -> String {
fatalError("unavailable function can't be called")
}
}
extension SequenceType where Generator.Element == String { extension SequenceType where Generator.Element == String {
/// Interpose the `separator` between elements of `self`, then concatenate /// Interpose the `separator` between elements of `self`, then concatenate

View File

@@ -140,17 +140,6 @@ extension String {
} }
} }
// Conversions from string to other types.
extension String {
/// If the string represents an integer that fits into an Int, returns
/// the corresponding integer. This accepts strings that match the regular
/// expression "[-+]?[0-9]+" only.
@available(*, unavailable, message="Use Int() initializer")
public func toInt() -> Int? {
fatalError("unavailable function can't be called")
}
}
extension String { extension String {
/// Produce a substring of the given string from the given character /// Produce a substring of the given string from the given character
/// index to the end of the string. /// index to the end of the string.

View File

@@ -15,9 +15,6 @@
/// When you use this type, you become partially responsible for /// When you use this type, you become partially responsible for
/// keeping the object alive. /// keeping the object alive.
public struct Unmanaged<Instance : AnyObject> { public struct Unmanaged<Instance : AnyObject> {
@available(*, unavailable, renamed="Instance")
public typealias T = Instance
internal unowned(unsafe) var _value: Instance internal unowned(unsafe) var _value: Instance
@_transparent @_transparent

View File

@@ -15,9 +15,6 @@
public struct UnsafeBufferPointerGenerator<Element> public struct UnsafeBufferPointerGenerator<Element>
: GeneratorType, SequenceType { : GeneratorType, SequenceType {
@available(*, unavailable, renamed="Element")
public typealias T = Element
/// Advance to the next element and return it, or `nil` if no next /// Advance to the next element and return it, or `nil` if no next
/// element exists. /// element exists.
public mutating func next() -> Element? { public mutating func next() -> Element? {
@@ -36,9 +33,6 @@ public struct UnsafeBufferPointerGenerator<Element>
public struct Unsafe${Mutable}BufferPointer<Element> public struct Unsafe${Mutable}BufferPointer<Element>
: ${Mutable}CollectionType { : ${Mutable}CollectionType {
@available(*, unavailable, renamed="Element")
public typealias T = Element
/// Always zero, which is the index of the first element in a /// Always zero, which is the index of the first element in a
/// non-empty buffer. /// non-empty buffer.
public var startIndex: Int { public var startIndex: Int {

View File

@@ -40,9 +40,6 @@ public struct ${Self}<Memory>
: RandomAccessIndexType, Hashable, : RandomAccessIndexType, Hashable,
NilLiteralConvertible, _PointerType { NilLiteralConvertible, _PointerType {
@available(*, unavailable, renamed="Memory")
public typealias T = Memory
public typealias Distance = Int public typealias Distance = Int
/// The underlying raw (untyped) pointer. /// The underlying raw (untyped) pointer.

View File

@@ -96,13 +96,3 @@ public struct Zip2Sequence<Sequence1 : SequenceType, Sequence2 : SequenceType>
internal let _sequences: (Sequence1, Sequence2) internal let _sequences: (Sequence1, Sequence2)
} }
@available(*, unavailable, renamed="Zip2Generator")
public struct ZipGenerator2<
Generator1 : GeneratorType, Generator2 : GeneratorType
> {}
@available(*, unavailable, renamed="Zip2Sequence")
public struct Zip2<
Sequence1 : SequenceType, Sequence2 : SequenceType
> {}

View File

@@ -203,173 +203,3 @@ func == (lhs: BadRandomAccessIndex3, rhs: BadRandomAccessIndex3) -> Bool {
fatalError("not implemented") fatalError("not implemented")
} }
extension Array {
func foo(element: T) {} // expected-error {{'T' has been renamed to 'Element'}} {{21-22=Element}}
}
extension ArraySlice {
func foo(element: T) {} // expected-error {{'T' has been renamed to 'Element'}} {{21-22=Element}}
}
extension ContiguousArray {
func foo(element: T) {} // expected-error {{'T' has been renamed to 'Element'}} {{21-22=Element}}
}
extension Set {
func foo(element: T) {} // expected-error {{'T' has been renamed to 'Element'}} {{21-22=Element}}
}
extension SetGenerator {
func foo(element: T) {} // expected-error {{'T' has been renamed to 'Element'}} {{21-22=Element}}
}
extension SetIndex {
func foo(element: T) {} // expected-error {{'T' has been renamed to 'Element'}} {{21-22=Element}}
}
extension Repeat {
func foo(element: T) {} // expected-error {{'T' has been renamed to 'Element'}} {{21-22=Element}}
}
extension GeneratorOfOne {
func foo(element: T) {} // expected-error {{'T' has been renamed to 'Element'}} {{21-22=Element}}
}
extension CollectionOfOne {
func foo(element: T) {} // expected-error {{'T' has been renamed to 'Element'}} {{21-22=Element}}
}
extension EmptyGenerator {
func foo(element: T) {} // expected-error {{'T' has been renamed to 'Element'}} {{21-22=Element}}
}
extension EmptyCollection {
func foo(element: T) {} // expected-error {{'T' has been renamed to 'Element'}} {{21-22=Element}}
}
extension UnsafeBufferPointerGenerator {
func foo(element: T) {} // expected-error {{'T' has been renamed to 'Element'}} {{21-22=Element}}
}
extension UnsafeBufferPointer {
func foo(element: T) {} // expected-error {{'T' has been renamed to 'Element'}} {{21-22=Element}}
}
extension UnsafeMutableBufferPointer {
func foo(element: T) {} // expected-error {{'T' has been renamed to 'Element'}} {{21-22=Element}}
}
extension Range {
func foo(element: T) {} // expected-error {{'T' has been renamed to 'Element'}} {{21-22=Element}}
}
extension RangeGenerator {
func foo(element: T) {} // expected-error {{'T' has been renamed to 'Element'}} {{21-22=Element}}
}
extension StrideToGenerator {
func foo(element: T) {} // expected-error {{'T' has been renamed to 'Element'}} {{21-22=Element}}
}
extension StrideTo {
func foo(element: T) {} // expected-error {{'T' has been renamed to 'Element'}} {{21-22=Element}}
}
extension StrideThroughGenerator {
func foo(element: T) {} // expected-error {{'T' has been renamed to 'Element'}} {{21-22=Element}}
}
extension StrideThrough {
func foo(element: T) {} // expected-error {{'T' has been renamed to 'Element'}} {{21-22=Element}}
}
extension AnyGenerator {
func foo(element: T) {} // expected-error {{'T' has been renamed to 'Element'}} {{21-22=Element}}
}
extension AnySequence {
func foo(element: T) {} // expected-error {{'T' has been renamed to 'Element'}} {{21-22=Element}}
}
extension AnyForwardCollection {
func foo(element: T) {} // expected-error {{'T' has been renamed to 'Element'}} {{21-22=Element}}
}
extension AnyBidirectionalCollection {
func foo(element: T) {} // expected-error {{'T' has been renamed to 'Element'}} {{21-22=Element}}
}
extension AnyRandomAccessCollection {
func foo(element: T) {} // expected-error {{'T' has been renamed to 'Element'}} {{21-22=Element}}
}
extension FilterSequenceView {} // expected-error {{'FilterSequenceView' has been renamed to 'FilterSequence'}} {{11-29=FilterSequence}}
extension FilterCollectionViewIndex {} // expected-error {{'FilterCollectionViewIndex' has been renamed to 'FilterCollectionIndex'}} {{11-36=FilterCollectionIndex}}
extension FilterCollectionView {} // expected-error {{'FilterCollectionView' has been renamed to 'FilterCollection'}} {{11-31=FilterCollection}}
extension LazyMapGenerator {
func foo(element: T) {} // expected-error {{'T' has been renamed to 'Element'}} {{21-22=Element}}
}
extension LazyMapSequence {
func foo(element: T) {} // expected-error {{'T' has been renamed to 'Element'}} {{21-22=Element}}
}
extension LazyMapCollection {
func foo(element: T) {} // expected-error {{'T' has been renamed to 'Element'}} {{21-22=Element}}
}
extension MapSequenceGenerator {} // expected-error {{'MapSequenceGenerator' has been renamed to 'LazyMapGenerator'}} {{11-31=LazyMapGenerator}}
extension MapSequenceView {} // expected-error {{'MapSequenceView' has been renamed to 'LazyMapSequence'}} {{11-26=LazyMapSequence}}
extension MapCollectionView {} // expected-error {{'MapCollectionView' has been renamed to 'LazyMapCollection'}} {{11-28=LazyMapCollection}}
extension LazySequence {
func foo(base: S) {} // expected-error {{'S' has been renamed to 'Base'}} {{18-19=Base}}
func bar() { _ = self.array } // expected-error {{please construct an Array from your lazy sequence}}
}
extension LazyCollection {
func foo(base: S) {} // expected-error {{'S' has been renamed to 'Base'}} {{18-19=Base}}
}
func foo<T>(_:LazyForwardCollection<T>) // expected-error {{'LazyForwardCollection' has been renamed to 'LazyCollection'}} {{15-36=LazyCollection}}
func foo<T>(_:LazyBidirectionalCollection<T>) // expected-error {{'LazyBidirectionalCollection' has been renamed to 'LazyCollection'}} {{15-42=LazyCollection}}
func foo<T>(_:LazyRandomAccessCollection<T>) // expected-error {{'LazyRandomAccessCollection' has been renamed to 'LazyCollection'}} {{15-41=LazyCollection}}
extension ReverseIndex {
func foo(base: I) {} // expected-error {{'I' has been renamed to 'Base'}} {{18-19=Base}}
}
extension ReverseRandomAccessIndex {
func foo(base: I) {} // expected-error {{'I' has been renamed to 'Base'}} {{18-19=Base}}
}
extension ReverseCollection {
func foo(base: T) {} // expected-error {{'T' has been renamed to 'Base'}} {{18-19=Base}}
}
extension ReverseRandomAccessCollection {
func foo(base: T) {} // expected-error {{'T' has been renamed to 'Base'}} {{18-19=Base}}
}
extension BidirectionalReverseView {} // expected-error {{'BidirectionalReverseView' has been renamed to 'ReverseCollection'}} {{11-35=ReverseCollection}}
extension RandomAccessReverseView {} // expected-error {{'RandomAccessReverseView' has been renamed to 'ReverseRandomAccessCollection'}} {{11-34=ReverseRandomAccessCollection}}
extension GeneratorSequence {
func foo(base: G) {} // expected-error {{'G' has been renamed to 'Base'}} {{18-19=Base}}
}
extension ZipGenerator2 {} // expected-error {{'ZipGenerator2' has been renamed to 'Zip2Generator'}} {{11-24=Zip2Generator}}
extension Zip2 {} // expected-error {{'Zip2' has been renamed to 'Zip2Sequence'}} {{11-15=Zip2Sequence}}
extension UnsafePointer {
func foo(memory: T) {} // expected-error {{'T' has been renamed to 'Memory'}} {{20-21=Memory}}
}
extension UnsafeMutablePointer {
func foo(memory: T) {} // expected-error {{'T' has been renamed to 'Memory'}} {{20-21=Memory}}
}
extension HalfOpenInterval {
func foo(bound: T) {} // expected-error {{'T' has been renamed to 'Bound'}} {{19-20=Bound}}
}
extension ClosedInterval {
func foo(bound: T) {} // expected-error {{'T' has been renamed to 'Bound'}} {{19-20=Bound}}
}
extension Unmanaged {
func foo(instance: T) {} // expected-error {{'T' has been renamed to 'Instance'}} {{22-23=Instance}}
}
struct MyCollection : Sliceable {} // expected-error {{'Sliceable' has been renamed to 'CollectionType'}} {{23-32=CollectionType}}
protocol MyProtocol : Sliceable {} // expected-error {{'Sliceable' has been renamed to 'CollectionType'}} {{23-32=CollectionType}}
func processCollection<E : Sliceable>(e: E) {} // expected-error {{'Sliceable' has been renamed to 'CollectionType'}} {{28-37=CollectionType}}
func renamedRangeReplaceableCollectionTypeMethods(c: DefaultedForwardRangeReplaceableCollection<Int>) {
var c = c
c.extend([ 10 ]) // expected-error {{'extend' has been renamed to 'appendContentsOf'}} {{5-11=appendContentsOf}}
c.splice([ 10 ], atIndex: c.startIndex) // expected-error {{'splice(_:atIndex:)' has been renamed to 'insertContentsOf'}} {{5-11=insertContentsOf}}
}
func renamedAnyGenerator<G : GeneratorType>(g: G) {
_ = anyGenerator(g) // expected-error {{'anyGenerator' has been renamed to 'AnyGenerator'}}
_ = anyGenerator { 1 } // expected-error {{'anyGenerator' has been renamed to 'AnyGenerator'}}
}

View File

@@ -1,8 +0,0 @@
// RUN: %target-parse-verify-swift
// REQUIRES: objc_interop
extension AutoreleasingUnsafeMutablePointer {
func foo(memory: T) {} // expected-error {{'T' has been renamed to 'Memory'}} {{20-21=Memory}}
}

View File

@@ -1,8 +0,0 @@
// RUN: %target-parse-verify-swift
func useQuickLookObject(object: QuickLookObject) {} // expected-error {{'QuickLookObject' has been renamed to 'PlaygroundQuickLook'}} {{33-48=PlaygroundQuickLook}}
func useReflecting() {
reflect(1) // expected-error {{'reflect' is unavailable: call the 'Mirror(reflecting:)' initializer}}
}

View File

@@ -2,11 +2,7 @@
var stream = "" var stream = ""
print(3, appendNewline: false) // expected-error {{'print(_:appendNewline:)' is unavailable: Please use 'terminator: ""' instead of 'appendNewline: false': 'print((...), terminator: "")'}}
debugPrint(3, appendNewline: false) // expected-error {{'debugPrint(_:appendNewline:)' is unavailable: Please use 'terminator: ""' instead of 'appendNewline: false': 'debugPrint((...), terminator: "")'}}
print(3, &stream) // expected-error{{'&' used with non-inout argument of type 'Any'}} print(3, &stream) // expected-error{{'&' used with non-inout argument of type 'Any'}}
debugPrint(3, &stream) // expected-error{{'&' used with non-inout argument of type 'Any'}} debugPrint(3, &stream) // expected-error{{'&' used with non-inout argument of type 'Any'}}
print(3, &stream, appendNewline: false) // expected-error {{cannot pass immutable value as inout argument: implicit conversion from 'String' to 'OutputStreamType' requires a temporary}}
debugPrint(3, &stream, appendNewline: false) // expected-error {{cannot pass immutable value as inout argument: implicit conversion from 'String' to 'OutputStreamType' requires a temporary}}
print(4, quack: 5) // expected-error {{'print' is unavailable: Please wrap your tuple argument in parentheses: 'print((...))'}} print(4, quack: 5) // expected-error {{'print' is unavailable: Please wrap your tuple argument in parentheses: 'print((...))'}}
debugPrint(4, quack: 5) // expected-error {{'debugPrint' is unavailable: Please wrap your tuple argument in parentheses: 'debugPrint((...))'}}

View File

@@ -110,12 +110,24 @@ infix operator ***~ {
func ***~(_: Int, _: String) { } func ***~(_: Int, _: String) { }
i ***~ i // expected-error{{cannot convert value of type 'Int' to expected argument type 'String'}} i ***~ i // expected-error{{cannot convert value of type 'Int' to expected argument type 'String'}}
@available(*, unavailable, message="call the 'map()' method on the sequence")
public func myMap<C : CollectionType, T>(
source: C, _ transform: (C.Generator.Element) -> T
) -> [T] {
fatalError("unavailable function can't be called")
}
@available(*, unavailable, message="call the 'map()' method on the optional value")
public func myMap<T, U>(x: T?, @noescape _ f: (T)->U) -> U? {
fatalError("unavailable function can't be called")
}
// <rdar://problem/20142523> // <rdar://problem/20142523>
// FIXME: poor diagnostic, to be fixed in 20142462. For now, we just want to // FIXME: poor diagnostic, to be fixed in 20142462. For now, we just want to
// make sure that it doesn't crash. // make sure that it doesn't crash.
func rdar20142523() { func rdar20142523() {
map(0..<10, { x in // expected-error{{cannot invoke 'map' with an argument list of type '(Range<Int>, (_) -> _)'}} myMap(0..<10, { x in // expected-error{{cannot invoke 'myMap' with an argument list of type '(Range<Int>, (_) -> _)'}}
// expected-note @-1 {{overloads for 'map' exist with these partially matching parameter lists: (C, (C.Generator.Element) -> T), (T?, @noescape (T) -> U)}} // expected-note @-1 {{overloads for 'myMap' exist with these partially matching parameter lists: (C, (C.Generator.Element) -> T), (T?, @noescape (T) -> U)}}
() ()
return x // expected-error {{type of expression is ambiguous without more context}} return x // expected-error {{type of expression is ambiguous without more context}}
}) })

View File

@@ -40,17 +40,6 @@ func foo() -> Int {
func goo(var e : ErrorType) {} func goo(var e : ErrorType) {}
struct Test1 : RawOptionSetType {
init(rawValue: Int) {}
var rawValue: Int { return 0 }
}
print("", appendNewline: false)
Swift.print("", appendNewline: false)
print("", appendNewline: true)
print("", false, appendNewline: false)
print("", false)
func ftest1() { func ftest1() {
// Don't replace the variable name with '_' // Don't replace the variable name with '_'
let myvar = 0 let myvar = 0

View File

@@ -40,17 +40,6 @@ func foo() -> Int {
func goo(e : ErrorType) {} func goo(e : ErrorType) {}
struct Test1 : OptionSetType {
init(rawValue: Int) {}
var rawValue: Int { return 0 }
}
print("", terminator: "")
Swift.print("", terminator: "")
print("", terminator: "\n")
print("", false, appendNewline: false)
print("", false)
func ftest1() { func ftest1() {
// Don't replace the variable name with '_' // Don't replace the variable name with '_'
let myvar = 0 let myvar = 0

View File

@@ -1694,9 +1694,6 @@ class HasNSManaged {
func mutableAutoreleasingUnsafeMutablePointerToAnyObject(p: AutoreleasingUnsafeMutablePointer<AnyObject>) {} func mutableAutoreleasingUnsafeMutablePointerToAnyObject(p: AutoreleasingUnsafeMutablePointer<AnyObject>) {}
// CHECK-LABEL: {{^}} @objc func mutableAutoreleasingUnsafeMutablePointerToAnyObject(p: AutoreleasingUnsafeMutablePointer<AnyObject>) { // CHECK-LABEL: {{^}} @objc func mutableAutoreleasingUnsafeMutablePointerToAnyObject(p: AutoreleasingUnsafeMutablePointer<AnyObject>) {
func cFunctionPointer(p: CFunctionPointer<() -> ()>) {} // expected-error{{unavailable}}
// CHECK-LABEL: {{^}} func cFunctionPointer(p: <<error type>>) -> <<error type>>
} }
// @objc with nullary names // @objc with nullary names

View File

@@ -1,4 +1,4 @@
// RUN: not --crash %target-swift-frontend %s -parse // RUN: not %target-swift-frontend %s -parse
// Distributed under the terms of the MIT license // Distributed under the terms of the MIT license
// Test case submitted to project by https://github.com/practicalswift (practicalswift) // Test case submitted to project by https://github.com/practicalswift (practicalswift)

View File

@@ -131,6 +131,3 @@ let u32_ops: UInt32 = testOps(5, 2)
let s64_ops: Int64 = testOps(5, 2) let s64_ops: Int64 = testOps(5, 2)
let u64_ops: UInt64 = testOps(5, 2) let u64_ops: UInt64 = testOps(5, 2)
func useWord(w: Word) {} // expected-error {{'Word' has been renamed to 'Int'}}
func useUWord(w: UWord) {} // expected-error {{'UWord' has been renamed to 'UInt'}}