Files
swift-mirror/validation-test/compiler_crashers_2_fixed/0018-rdar21524144.swift
David Farler b7d17b25ba Rename -parse flag to -typecheck
A parse-only option is needed for parse performance tracking and the
current option also includes semantic analysis.
2016-11-28 10:50:55 -08:00

31 lines
655 B
Swift

// RUN: not %target-swift-frontend %s -typecheck
public protocol Indexable {
typealias Index : ForwardIndex
var startIndex: Index {get}
var endIndex: Index {get}
typealias _Element
subscript(_i: Index) -> _Element {get}
}
protocol Collection : Indexable, Sequence {}
public struct IndexingIterator<Elements : Indexable>
: IteratorProtocol, Sequence {
public func makeIterator() -> IndexingIterator {
return self
}
public mutating func next() -> Elements._Element? {
return nil
}
}
extension Sequence where Self : Collection {
func makeIterator() -> IndexingIterator<Self> {
return IndexingIterator(self)
}
}