@@ -728,14 +728,47 @@ extension AnySequence: Sequence {
728
728
extension Any ${ Kind} {
729
729
% if Kind == 'Sequence':
730
730
/// Returns an iterator over the elements of this sequence.
731
+ @inline ( __always)
732
+ @inlinable
733
+ public __consuming func makeIterator( ) -> Iterator {
734
+ return _box. _makeIterator ( )
735
+ }
736
+ @inlinable
737
+ public __consuming func dropLast( _ n: Int = 1 ) -> [ Element ] {
738
+ return _box. _dropLast ( n)
739
+ }
740
+ @inlinable
741
+ public __consuming func prefix(
742
+ while predicate: ( Element ) throws -> Bool
743
+ ) rethrows -> [ Element ] {
744
+ return try _box. _prefix ( while: predicate)
745
+ }
746
+ @inlinable
747
+ public __consuming func suffix( _ maxLength: Int ) -> [ Element ] {
748
+ return _box. _suffix ( maxLength)
749
+ }
731
750
% else :
732
751
/// Returns an iterator over the elements of this collection.
733
- % end
734
752
@inline ( __always)
735
753
@inlinable
736
754
public __consuming func makeIterator( ) -> Iterator {
737
755
return _box. _makeIterator ( )
738
756
}
757
+ @inlinable
758
+ public __consuming func dropLast( _ n: Int = 1 ) -> Any ${ Kind} < Element> {
759
+ return Any${ Kind} ( _box: _box. _dropLast ( n) )
760
+ }
761
+ @inlinable
762
+ public __consuming func prefix(
763
+ while predicate: ( Element ) throws -> Bool
764
+ ) rethrows -> Any ${ Kind} < Element> {
765
+ return try Any${ Kind} ( _box: _box. _prefix ( while: predicate) )
766
+ }
767
+ @inlinable
768
+ public __consuming func suffix( _ maxLength: Int ) -> Any ${ Kind} < Element> {
769
+ return Any${ Kind} ( _box: _box. _suffix ( maxLength) )
770
+ }
771
+ % end
739
772
740
773
@inlinable
741
774
public var underestimatedCount : Int {
@@ -763,7 +796,6 @@ extension Any${Kind} {
763
796
return try _box. _forEach ( body)
764
797
}
765
798
766
- /*
767
799
@inlinable
768
800
public __consuming func drop(
769
801
while predicate: ( Element ) throws -> Bool
@@ -772,33 +804,15 @@ extension Any${Kind} {
772
804
}
773
805
774
806
@inlinable
775
- public __consuming func dropFirst(_ n: Int) -> Any${Kind}<Element> {
807
+ public __consuming func dropFirst( _ n: Int = 1 ) -> Any ${ Kind} < Element> {
776
808
return Any${ Kind} ( _box: _box. _dropFirst ( n) )
777
809
}
778
810
779
- @inlinable
780
- public __consuming func dropLast(_ n: Int) -> Any${Kind}<Element> {
781
- return Any${Kind}(_box: _box._dropLast(n))
782
- }
783
-
784
- @inlinable
785
- public __consuming func prefix(
786
- while predicate: (Element) throws -> Bool
787
- ) rethrows -> Any${Kind}<Element> {
788
- return try Any${Kind}(_box: _box._prefix(while: predicate))
789
- }
790
-
791
811
@inlinable
792
812
public __consuming func prefix( _ maxLength: Int ) -> Any ${ Kind} < Element> {
793
813
return Any${ Kind} ( _box: _box. _prefix ( maxLength) )
794
814
}
795
815
796
- @inlinable
797
- public __consuming func suffix(_ maxLength: Int) -> Any${Kind}<Element> {
798
- return Any${Kind}(_box: _box._suffix(maxLength))
799
- }
800
- */
801
-
802
816
@inlinable
803
817
public func _customContainsEquatableElement(
804
818
_ element: Element
0 commit comments