Skip to content

Commit 25ac879

Browse files
committed
[noescape by default] Fix benchmarks and incorporate feedback
Adds @escaping to internal benchmark code to fix it. References SR for known limitation. Use stdlib coding style for arguments.
1 parent c37751a commit 25ac879

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

benchmark/single-source/Integrate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class Integrate {
2020

2121
let fun: (Double) -> Double
2222

23-
init (f: (Double) -> Double) {
23+
init (f: @escaping (Double) -> Double) {
2424
fun = f
2525
}
2626

benchmark/utils/DriverUtils.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ struct Test {
5050
let index: Int
5151
let f: (Int) -> ()
5252
var run: Bool
53-
init(name: String, n: Int, f: (Int) -> ()) {
53+
init(name: String, n: Int, f: @escaping (Int) -> ()) {
5454
self.name = name
5555
self.index = n
5656
self.f = f

test/IDE/complete_override.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ class TestClassWithThrows : HasThrowing, HasThrowingProtocol {
463463
// HAS_THROWING: Begin completions
464464
// HAS_THROWING-DAG: Decl[InstanceMethod]/Super: func foo() throws {|}; name=foo() throws
465465
// HAS_THROWING-DAG: Decl[InstanceMethod]/Super: override func bar() throws {|}; name=bar() throws
466-
// FIXME: make the below require to print @escaping
466+
// FIXME: SR-2214 make the below require printing @escaping
467467
// HAS_THROWING-DAG: Decl[InstanceMethod]/Super: override func baz(x: {{(@escaping )?}}() throws -> ()) rethrows {|}; name=baz(x: {{(@escaping )?}}() throws -> ()) rethrows
468468
// HAS_THROWING-DAG: Decl[Constructor]/Super: init() throws {|}; name=init() throws
469469
// HAS_THROWING: End completions

validation-test/stdlib/HashingAvalanche.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@ import StdlibUnittest
88

99
var HashingTestSuite = TestSuite("Hashing")
1010

11-
func avalancheTest(_ bits: Int, _ hashUnderTest: @escaping (UInt64) -> UInt64,
12-
_ pValue: Double) {
11+
func avalancheTest(
12+
_ bits: Int,
13+
_ hashUnderTest: @escaping (UInt64) -> UInt64,
14+
_ pValue: Double
15+
) {
1316
let testsInBatch = 100000
1417
let testData = randArray64(testsInBatch)
1518
let testDataHashed = Array(testData.lazy.map { hashUnderTest($0) })

0 commit comments

Comments
 (0)