class _AnySequenceBox<Element> { internal func _makeIterator() -> AnyIterator<Element> { _abstract() } } final class _SequenceBox<S> : _AnySequenceBox<S.Iterator.Element> { internal override func _makeIterator() -> AnyIterator<Element> { return AnyIterator(_base.makeIterator()) } } struct AnySequence<Element> : Sequence { public init<S : Sequence>(_ base: S) where S.Element == Element { self._box = _SequenceBox(_base: base) } internal let _box: _AnySequenceBox<Element> }
internal func _abstract( file: StaticString = #file, line: UInt = #line ) -> Never { fatalError("Method must be overridden", file: file, line: line) }