Files
swift-mirror/validation-test/compiler_crashers_fixed/0018-rdar21524144.swift
Hamish Knight 4e811c3a88 [test] Merge crasher directories
There is no longer much of a good reason to keep these separate,
merge them.
2025-10-18 12:51:30 +01: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)
}
}