mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[stdlib] Add Sequence.Element, change ExpressibleByArrayLiteral.Element to ArrayLiteralElement (#8990)
* Give Sequence a top-level Element, constrain Iterator to match * Remove many instances of Iterator. * Fixed various hard-coded tests * XFAIL a few tests that need further investigation * Change assoc type for arrayLiteralConvertible * Mop up remaining "better expressed as a where clause" warnings * Fix UnicodeDecoders prototype test * Fix UIntBuffer * Fix hard-coded Element identifier in CSDiag * Fix up more tests * Account for flatMap changes
This commit is contained in:
@@ -389,7 +389,7 @@ extension String.UnicodeScalarView : RangeReplaceableCollection {
|
||||
///
|
||||
/// - Complexity: O(*n*), where *n* is the length of the resulting view.
|
||||
public mutating func append<S : Sequence>(contentsOf newElements: S)
|
||||
where S.Iterator.Element == Unicode.Scalar {
|
||||
where S.Element == Unicode.Scalar {
|
||||
_core.append(contentsOf: newElements.lazy.flatMap { $0.utf16 })
|
||||
}
|
||||
|
||||
@@ -411,7 +411,7 @@ extension String.UnicodeScalarView : RangeReplaceableCollection {
|
||||
public mutating func replaceSubrange<C>(
|
||||
_ bounds: Range<Index>,
|
||||
with newElements: C
|
||||
) where C : Collection, C.Iterator.Element == Unicode.Scalar {
|
||||
) where C : Collection, C.Element == Unicode.Scalar {
|
||||
let rawSubRange: Range<Int> = _toCoreIndex(bounds.lowerBound) ..<
|
||||
_toCoreIndex(bounds.upperBound)
|
||||
let lazyUTF16 = newElements.lazy.flatMap { $0.utf16 }
|
||||
|
||||
Reference in New Issue
Block a user