Skip to content

Commit 275875c

Browse files
committed
Introduce type annotations to permit use of one-way closure parameters.
There are two places in our normal build that are missing type annotations that would become required with one-way closure parameters. Introduce type annotations so that we can build enough of the code base to perform additional testing. These changes are unnecessary (but harmless) if nothing comes of the one-way closure experiment.
1 parent 64f903f commit 275875c

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

stdlib/private/StdlibUnittest/RaceTest.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,9 @@ func _masterThreadOneTrial<RT>(_ sharedState: _RaceTestSharedState<RT>) {
477477
observations.append(sharedState.workerStates[j].observations[i])
478478
}
479479

480-
let sink = { sharedState.aggregatedEvaluations.addEvaluation($0) }
480+
let sink = { (x: RaceTestObservationEvaluation) in
481+
sharedState.aggregatedEvaluations.addEvaluation(x)
482+
}
481483
rt.evaluateObservations(observations, sink)
482484
observations.removeAll(keepingCapacity: true)
483485
}

stdlib/public/Differentiation/DifferentialOperators.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public func transpose<T, R>(
2323
of body: @escaping @differentiable(linear) (T) -> R
2424
) -> @differentiable(linear) (R) -> T {
2525
let original = body as (T) -> R
26-
let transpose = { x in Builtin.applyTranspose_arity1(body, x) }
26+
let transpose = { (x: R) in Builtin.applyTranspose_arity1(body, x) }
2727
return Builtin.linearFunction_arity1(transpose, original)
2828
}
2929

0 commit comments

Comments
 (0)