Skip to content

Commit faba513

Browse files
committed
Constrain Lazy.Elements.Element == Element
1 parent f6f3ed0 commit faba513

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

stdlib/public/core/Flatten.swift.gyb

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,7 @@ extension Sequence where Iterator.Element : Sequence {
133133
}
134134
}
135135

136-
extension LazySequenceProtocol
137-
where
138-
Elements.Iterator.Element == Iterator.Element,
139-
Iterator.Element : Sequence {
136+
extension LazySequenceProtocol where Iterator.Element : Sequence {
140137

141138
/// Returns a lazy sequence that concatenates the elements of this sequence of
142139
/// sequences.
@@ -418,11 +415,11 @@ extension LazyCollectionProtocol
418415
Self : ${collectionForTraversal(traversal)},
419416
Elements : ${collectionForTraversal(traversal)},
420417
% end
421-
${constraints % {'Base': 'Elements.'}},
422-
Iterator.Element == Elements.Iterator.Element {
423-
/// A concatenation of the elements of `self`.
424-
public func joined() -> LazyCollection<${Collection}<Elements>> {
425-
return ${Collection}(elements).lazy
418+
${constraints % {'Base': 'Elements.'}}
419+
{
420+
/// A concatenation of the elements of `self`.
421+
public func joined() -> LazyCollection<${Collection}<Elements>> {
422+
return ${Collection}(elements).lazy
426423
}
427424

428425
@available(*, unavailable, renamed: "joined()")

stdlib/public/core/LazySequence.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ public protocol LazySequenceProtocol : Sequence {
133133
///
134134
/// - See also: `elements`
135135
associatedtype Elements : Sequence = Self
136+
where Elements.Iterator.Element == Iterator.Element
136137

137138
/// A sequence containing the same elements as this one, possibly with
138139
/// a simpler type.

0 commit comments

Comments
 (0)