Skip to content

Commit 011a115

Browse files
committed
Group operators explicitly.
The '+' operator binds tighter than the '...' operator. Fixes rdar://problem/59833804
1 parent bc5f015 commit 011a115

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

stdlib/public/core/RangeReplaceableCollection.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -952,7 +952,7 @@ extension RangeReplaceableCollection {
952952
/// concatenate the elements of an integer array and a `Range<Int>` instance.
953953
///
954954
/// let numbers = [1, 2, 3, 4]
955-
/// let moreNumbers = numbers + 5...10
955+
/// let moreNumbers = numbers + (5...10)
956956
/// print(moreNumbers)
957957
/// // Prints "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]"
958958
///
@@ -981,7 +981,7 @@ extension RangeReplaceableCollection {
981981
/// concatenate the elements of a `Range<Int>` instance and an integer array.
982982
///
983983
/// let numbers = [7, 8, 9, 10]
984-
/// let moreNumbers = 1...6 + numbers
984+
/// let moreNumbers = (1...6) + numbers
985985
/// print(moreNumbers)
986986
/// // Prints "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]"
987987
///

0 commit comments

Comments
 (0)