Skip to content

Commit 5845908

Browse files
committed
Constrain lazy elements.element == element
1 parent 1eaf9cf commit 5845908

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

stdlib/public/core/Flatten.swift.gyb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -418,8 +418,7 @@ extension LazyCollectionProtocol
418418
Self : ${collectionForTraversal(traversal)},
419419
Elements : ${collectionForTraversal(traversal)},
420420
% end
421-
${constraints % {'Base': 'Elements.'}},
422-
Element == Elements.Element {
421+
${constraints % {'Base': 'Elements.'}} {
423422
/// A concatenation of the elements of `self`.
424423
public func joined() -> LazyCollection<${Collection}<Elements>> {
425424
return ${Collection}(elements).lazy

stdlib/public/core/LazyCollection.swift.gyb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public protocol LazyCollectionProtocol
2929
/// possibly with a simpler type.
3030
///
3131
/// - See also: `elements`
32-
associatedtype Elements : Collection = Self
32+
associatedtype Elements : Collection = Self where Elements.Element == Element
3333
}
3434

3535
/// When there's no special associated `Elements` type, the `elements`

0 commit comments

Comments
 (0)