Skip to content

Commit fc37603

Browse files
authored
Revert "Implement SE-0118"
1 parent 3b378f7 commit fc37603

File tree

64 files changed

+348
-380
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+348
-380
lines changed

benchmark/single-source/CaptureProp.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ func benchCaptureProp<S : Sequence
2121

2222
var it = s.makeIterator()
2323
let initial = it.next()!
24-
return IteratorSequence(it).reduce(initial, f)
24+
return IteratorSequence(it).reduce(initial, combine: f)
2525
}
2626

2727
public func run_CaptureProp(_ N: Int) {

benchmark/single-source/MapReduce.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public func run_MapReduce(_ N: Int) {
2020
var c = 0
2121
for _ in 1...N*100 {
2222
numbers = numbers.map({$0 &+ 5})
23-
c += numbers.reduce(0, &+)
23+
c += numbers.reduce(0, combine: &+)
2424
}
2525
CheckResults(c != 0, "IncorrectResults in MapReduce")
2626
}

benchmark/single-source/SortStrings.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1021,7 +1021,7 @@ func benchSortStrings(_ words: [String]) {
10211021
// Notice that we _copy_ the array of words before we sort it.
10221022
// Pass an explicit '<' predicate to benchmark reabstraction thunks.
10231023
var tempwords = words
1024-
tempwords.sort(by: <)
1024+
tempwords.sort(isOrderedBefore: <)
10251025
}
10261026

10271027
public func run_SortStrings(_ N: Int) {

stdlib/private/StdlibCollectionUnittest/LoggingWrappers.swift.gyb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,10 +229,10 @@ public struct ${Self}<
229229
}
230230

231231
public func filter(
232-
_ isIncluded: @noescape (Base.Iterator.Element) throws -> Bool
232+
_ includeElement: @noescape (Base.Iterator.Element) throws -> Bool
233233
) rethrows -> [Base.Iterator.Element] {
234234
Log.filter[selfType] += 1
235-
return try base.filter(isIncluded)
235+
return try base.filter(includeElement)
236236
}
237237

238238
public func forEach(
@@ -274,13 +274,13 @@ public struct ${Self}<
274274
public func split(
275275
maxSplits: Int = Int.max,
276276
omittingEmptySubsequences: Bool = true,
277-
whereSeparator isSeparator: @noescape (Base.Iterator.Element) throws -> Bool
277+
isSeparator: @noescape (Base.Iterator.Element) throws -> Bool
278278
) rethrows -> [SubSequence] {
279279
Log.split[selfType] += 1
280280
return try base.split(
281281
maxSplits: maxSplits,
282282
omittingEmptySubsequences: omittingEmptySubsequences,
283-
whereSeparator: isSeparator)
283+
isSeparator: isSeparator)
284284
}
285285

286286
public func _customContainsEquatableElement(

stdlib/private/StdlibUnittest/RaceTest.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -596,9 +596,7 @@ internal struct ClosureBasedRaceTest : RaceTestWithPerTrialData {
596596
) {}
597597
}
598598

599-
public func runRaceTest(
600-
trials: Int, threads: Int? = nil, invoking body: () -> ()
601-
) {
599+
public func runRaceTest(trials: Int, threads: Int? = nil, body: () -> ()) {
602600
ClosureBasedRaceTest.thread = body
603601
runRaceTest(ClosureBasedRaceTest.self, trials: trials, threads: threads)
604602
}

stdlib/private/StdlibUnittest/StdlibCoreExtras.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ extension MutableCollection
214214
}
215215

216216
/// Generate all permutations.
217-
public func forAllPermutations(_ size: Int, _ body: ([Int]) -> Void) {
217+
public func forAllPermutations(_ size: Int, body: ([Int]) -> Void) {
218218
var data = Array(0..<size)
219219
repeat {
220220
body(data)
@@ -223,7 +223,7 @@ public func forAllPermutations(_ size: Int, _ body: ([Int]) -> Void) {
223223

224224
/// Generate all permutations.
225225
public func forAllPermutations<S : Sequence>(
226-
_ sequence: S, _ body: ([S.Iterator.Element]) -> Void
226+
_ sequence: S, body: ([S.Iterator.Element]) -> Void
227227
) {
228228
let data = Array(sequence)
229229
forAllPermutations(data.count) {

stdlib/private/StdlibUnittest/StdlibUnittest.swift.gyb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ var _seenExpectCrash = false
107107
/// Run `body` and expect a failure to happen.
108108
///
109109
/// The check passes iff `body` triggers one or more failures.
110-
public func expectFailure(${TRACE}, invoking body: () -> Void) {
110+
public func expectFailure(${TRACE}, body: () -> Void) {
111111
let startAnyExpectFailed = _anyExpectFailed
112112
_anyExpectFailed = false
113113
body()
@@ -2244,7 +2244,7 @@ public func expectEqualSequence<
22442244
) where
22452245
Expected.Iterator.Element == Actual.Iterator.Element {
22462246

2247-
if !expected.elementsEqual(actual, by: sameValue) {
2247+
if !expected.elementsEqual(actual, isEquivalent: sameValue) {
22482248
expectationFailure("expected elements: \"\(expected)\"\n"
22492249
+ "actual: \"\(actual)\" (of type \(String(reflecting: actual.dynamicType)))",
22502250
trace: ${trace})
@@ -2262,9 +2262,9 @@ public func expectEqualsUnordered<
22622262
Expected.Iterator.Element == Actual.Iterator.Element {
22632263

22642264
let x: [Expected.Iterator.Element] =
2265-
expected.sorted(by: compose(compare, { $0.isLT() }))
2265+
expected.sorted(isOrderedBefore: compose(compare, { $0.isLT() }))
22662266
let y: [Actual.Iterator.Element] =
2267-
actual.sorted(by: compose(compare, { $0.isLT() }))
2267+
actual.sorted(isOrderedBefore: compose(compare, { $0.isLT() }))
22682268
expectEqualSequence(
22692269
x, y, ${trace}, sameValue: compose(compare, { $0.isEQ() }))
22702270
}
@@ -2361,10 +2361,10 @@ public func expectEqualsUnordered<
23612361
}
23622362

23632363
let x: [(T, T)] =
2364-
expected.sorted(by: comparePairLess)
2364+
expected.sorted(isOrderedBefore: comparePairLess)
23652365
let y: [(T, T)] =
23662366
actual.map { ($0.0, $0.1) }
2367-
.sorted(by: comparePairLess)
2367+
.sorted(isOrderedBefore: comparePairLess)
23682368

23692369
func comparePairEquals(_ lhs: (T, T), rhs: (key: T, value: T)) -> Bool {
23702370
return lhs.0 == rhs.0 && lhs.1 == rhs.1

stdlib/private/StdlibUnittest/TypeIndexed.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ extension TypeIndexed where Value : Strideable {
5959
showFrame: Bool = true,
6060
stackTrace: SourceLocStack = SourceLocStack(),
6161
file: String = #file, line: UInt = #line,
62-
invoking body: () -> R
62+
body: () -> R
6363
) -> R {
6464
let expected = self[t].advanced(by: 1)
6565
let r = body()
@@ -77,7 +77,7 @@ extension TypeIndexed where Value : Equatable {
7777
showFrame: Bool = true,
7878
stackTrace: SourceLocStack = SourceLocStack(),
7979
file: String = #file, line: UInt = #line,
80-
invoking body: () -> R
80+
body: () -> R
8181
) -> R {
8282
let expected = self[t]
8383
let r = body()

stdlib/private/StdlibUnittestFoundationExtras/StdlibUnittestFoundationExtras.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public func withOverriddenLocaleCurrentLocale<Result>(
6565
/// return-autoreleased optimization.)
6666
@inline(never)
6767
public func autoreleasepoolIfUnoptimizedReturnAutoreleased(
68-
invoking body: @noescape () -> Void
68+
_ body: @noescape () -> Void
6969
) {
7070
#if arch(i386) && (os(iOS) || os(watchOS))
7171
autoreleasepool(body)

stdlib/public/SDK/Foundation/NSStringAPI.swift

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,7 @@ extension Optional {
7676
/// `body` is complicated than that results in unnecessarily repeated code.
7777
internal func _withNilOrAddress<NSType : AnyObject, ResultType>(
7878
of object: inout NSType?,
79-
_ body:
80-
@noescape (AutoreleasingUnsafeMutablePointer<NSType?>?) -> ResultType
79+
body: @noescape (AutoreleasingUnsafeMutablePointer<NSType?>?) -> ResultType
8180
) -> ResultType {
8281
return self == nil ? body(nil) : body(&object)
8382
}
@@ -496,9 +495,7 @@ extension String {
496495
// enumerateLinesUsing:(void (^)(NSString *line, BOOL *stop))block
497496

498497
/// Enumerates all the lines in a string.
499-
public func enumerateLines(
500-
invoking body: (line: String, stop: inout Bool) -> ()
501-
) {
498+
public func enumerateLines(_ body: (line: String, stop: inout Bool) -> ()) {
502499
_ns.enumerateLines {
503500
(line: String, stop: UnsafeMutablePointer<ObjCBool>)
504501
in
@@ -529,7 +526,7 @@ extension String {
529526
scheme tagScheme: String,
530527
options opts: NSLinguisticTagger.Options = [],
531528
orthography: NSOrthography? = nil,
532-
invoking body:
529+
_ body:
533530
(String, Range<Index>, Range<Index>, inout Bool) -> ()
534531
) {
535532
_ns.enumerateLinguisticTags(

0 commit comments

Comments
 (0)