Skip to content

Commit 769a7d7

Browse files
author
Dave Abrahams
committed
[stdlib] Modernize some test code
It was warning about the where clause position
1 parent d16ffcf commit 769a7d7

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

test/Prototypes/Algorithms.swift.gyb

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -374,8 +374,8 @@ public func == <C1: Collection, C2: Collection>(
374374
% Self = "Concatenated" + Collection
375375

376376
/// A concatenation of two collections with the same element type.
377-
public struct ${Self}<C1 : ${Collection}, C2: ${Collection}
378-
where C1.Iterator.Element == C2.Iterator.Element>: ${Collection} {
377+
public struct ${Self}<C1 : ${Collection}, C2: ${Collection}>: ${Collection}
378+
where C1.Iterator.Element == C2.Iterator.Element {
379379

380380
init(_base1: C1, base2: C2) {
381381
self._base1 = _base1
@@ -488,8 +488,8 @@ public struct ${Self}<C1 : ${Collection}, C2: ${Collection}
488488
/// first collection and then the elements of the second collection.
489489
func concatenate<
490490
C1 : ${Collection}, C2 : ${Collection}
491-
where C1.Iterator.Element == C2.Iterator.Element
492-
>(_ first: C1, _ second: C2) -> ${Self}<C1, C2> {
491+
>(_ first: C1, _ second: C2) -> ${Self}<C1, C2>
492+
where C1.Iterator.Element == C2.Iterator.Element {
493493
return ${Self}(_base1: first, base2: second)
494494
}
495495

@@ -499,22 +499,23 @@ func concatenate<
499499
//===----------------------------------------------------------------------===//
500500

501501
/// A position in a rotated collection.
502-
public struct RotatedCollectionIndex<
503-
Base : Collection where Base.SubSequence: Collection
504-
> : Comparable {
502+
public struct RotatedCollectionIndex<Base : Collection> : Comparable
503+
where Base.SubSequence: Collection {
505504
internal let _index:
506505
ConcatenatedCollectionIndex<Base.SubSequence, Base.SubSequence>
507506
}
508507

509-
public func < <Base: Collection where Base.SubSequence: Collection>(
508+
public func < <Base: Collection>(
510509
lhs: RotatedCollectionIndex<Base>, rhs: RotatedCollectionIndex<Base>
511-
) -> Bool {
510+
) -> Bool
511+
where Base.SubSequence: Collection {
512512
return lhs._index < rhs._index
513513
}
514514

515-
public func == <Base: Collection where Base.SubSequence: Collection>(
515+
public func == <Base: Collection>(
516516
lhs: RotatedCollectionIndex<Base>, rhs: RotatedCollectionIndex<Base>
517-
) -> Bool {
517+
) -> Bool
518+
where Base.SubSequence: Collection {
518519
return lhs._index == rhs._index
519520
}
520521

@@ -524,8 +525,9 @@ public func == <Base: Collection where Base.SubSequence: Collection>(
524525

525526
/// A rotated view onto a `${Collection}`.
526527
public struct ${Self}<
527-
Base : ${Collection} where Base.SubSequence: ${Collection}
528-
> : ${Collection} {
528+
Base : ${Collection}
529+
> : ${Collection}
530+
where Base.SubSequence: ${Collection} {
529531
let _concatenation: Concatenated${Collection}<
530532
Base.SubSequence, Base.SubSequence>
531533

0 commit comments

Comments
 (0)