Skip to content

Commit 1c3d998

Browse files
author
Dave Abrahams
committed
Revert "[gardening] "Type->Type" → "Type -> Type" in Swift code"
This reverts commit 14edeaf because it's breaking tests: https://ci.swift.org/job/oss-swift-incremental-RA-osx/lastFailedBuild/consoleFull#1361088108ee1a197b-acac-4b17-83cf-a53b95139a76
1 parent d97e7d9 commit 1c3d998

File tree

16 files changed

+27
-27
lines changed

16 files changed

+27
-27
lines changed

benchmark/single-source/CaptureProp.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ func sum(_ x:Int, y:Int) -> Int {
1717
@inline(never)
1818
func benchCaptureProp<S : Sequence
1919
>(
20-
_ s: S, _ f: (S.Iterator.Element, S.Iterator.Element) -> S.Iterator.Element) -> S.Iterator.Element {
20+
_ s: S, _ f:(S.Iterator.Element, S.Iterator.Element)->S.Iterator.Element) -> S.Iterator.Element {
2121

2222
var it = s.makeIterator()
2323
let initial = it.next()!

benchmark/single-source/Integrate.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ import TestsUtils
1818
class Integrate {
1919
static let epsilon = 1.0e-9;
2020

21-
let fun: (Double) -> Double;
21+
let fun:(Double)->Double;
2222

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

27-
private func recEval(_ l: Double, fl: Double, r: Double, fr: Double, a: Double) -> Double {
27+
private func recEval(_ l:Double, fl:Double, r:Double, fr:Double, a:Double)->Double {
2828
let h = (r - l) / 2
2929
let hh = h / 2
3030
let c = l + h
@@ -43,7 +43,7 @@ class Integrate {
4343
}
4444

4545
@inline(never)
46-
func computeArea(_ left: Double, right: Double) -> Double {
46+
func computeArea(_ left: Double, right:Double)->Double {
4747
return recEval(left, fl:fun(left), r:right, fr:fun(right), a:0)
4848
}
4949
}

benchmark/single-source/Prims.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ extension Edge : Hashable {
183183
}
184184
}
185185

186-
func Prims(_ graph : Array<GraphNode>, _ fun : (Int, Int) -> Double) -> Array<Int?> {
186+
func Prims(_ graph : Array<GraphNode>, _ fun : (Int, Int)->Double) -> Array<Int?> {
187187
var treeEdges = Array<Int?>(repeating:nil, count:graph.count)
188188

189189
let queue = PriorityQueue(Num:graph.count)

benchmark/utils/DriverUtils.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,18 +48,18 @@ extension BenchResults : CustomStringConvertible {
4848
struct Test {
4949
let name: String
5050
let index: Int
51-
let f: (Int) -> ()
51+
let f: (Int)->()
5252
var run: Bool
53-
init(name: String, n: Int, f: (Int) -> ()) {
53+
init(name: String, n: Int, f: (Int)->()) {
5454
self.name = name
5555
self.index = n
5656
self.f = f
5757
run = true
5858
}
5959
}
6060

61-
public var precommitTests: [String : (Int) -> ()] = [:]
62-
public var otherTests: [String : (Int) -> ()] = [:]
61+
public var precommitTests: [String : (Int)->()] = [:]
62+
public var otherTests: [String : (Int)->()] = [:]
6363

6464
enum TestAction {
6565
case Run

stdlib/private/StdlibUnittest/StdlibUnittest.swift.gyb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ public func expectNotEqual<T : Equatable>(_ expected: T, _ actual: T, ${TRACE})
182182
}
183183

184184
// Cannot write a sane set of overloads using generics because of:
185-
// <rdar://problem/17015923> Array -> NSArray implicit conversion insanity
185+
// <rdar://problem/17015923> Array->NSArray implicit conversion insanity
186186
public func expectOptionalEqual<T : Equatable>(
187187
_ expected: T, _ actual: T?, ${TRACE}
188188
) {

stdlib/public/core/Print.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public func print(
3131
#if os(Windows)
3232
// FIXME: This fix is for 'crash at hook(output.left)' in cygwin.
3333
// Proper fix is needed. see: https://bugs.swift.org/browse/SR-612
34-
let _playgroundPrintHook: ((String) -> Void)? = nil
34+
let _playgroundPrintHook: ((String)->Void)? = nil
3535
#endif
3636
if let hook = _playgroundPrintHook {
3737
var output = _TeeStream(left: "", right: _Stdout())

test/1_stdlib/NewArray.swift.gyb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ func test<
144144
checkEqual(x, y, false)
145145

146146
func checkReallocations(
147-
_ a: T, _ growthDescription: String, _ growBy1: (_: inout T) -> ()
147+
_ a: T, _ growthDescription: String, _ growBy1: (_: inout T)->()
148148
) {
149149
var a = a
150150
var reallocations = 0

test/1_stdlib/Tuple.swift.gyb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ var TupleTestSuite = TestSuite("Tuple")
2020
func testEquality<A : Equatable, B : Equatable, C : Equatable>(
2121
_ lhs: (A, B, C), equal: Bool, to rhs: (A, B, C),
2222
//===--- TRACE boilerplate ----------------------------------------------===//
23-
@autoclosure _ message: () -> String = "",
23+
@autoclosure _ message: ()->String = "",
2424
showFrame: Bool = true,
2525
stackTrace: SourceLocStack = SourceLocStack(),
2626
file: String = #file, line: UInt = #line
@@ -94,7 +94,7 @@ enum Ordering : Equatable {
9494
func testOrdering<A : Comparable, B : Comparable, C : Comparable>(
9595
_ lhs: (A, B, C), _ ordering: Ordering, _ rhs: (A, B, C),
9696
//===--- TRACE boilerplate ----------------------------------------------===//
97-
@autoclosure _ message: () -> String = "",
97+
@autoclosure _ message: ()->String = "",
9898
showFrame: Bool = true,
9999
stackTrace: SourceLocStack = SourceLocStack(),
100100
file: String = #file, line: UInt = #line

test/Constraints/diagnostics.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ public func myMap<C : Collection, T>(
147147
}
148148

149149
@available(*, unavailable, message: "call the 'map()' method on the optional value")
150-
public func myMap<T, U>(_ x: T?, @noescape _ f: (T) -> U) -> U? {
150+
public func myMap<T, U>(_ x: T?, @noescape _ f: (T)->U) -> U? {
151151
fatalError("unavailable function can't be called")
152152
}
153153

test/Prototypes/CollectionsMoveIndices.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@
324324
// a small number of commonly used algorithms that require that
325325
// property, and they can be provided as methods on the collection,
326326
// for example removeAll(in: Range<Index>) and
327-
// removeAll(_: (Element) -> Bool).
327+
// removeAll(_: (Element)->Bool).
328328
//
329329
// If we were to allow reference-counted indices (basically, the
330330
// current collections model), then an additional design is possible

test/Prototypes/Integers.swift.gyb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ public func _assertCond(
126126
/// Prints the message if the body is uncommented; used for
127127
/// diagnostics.
128128
@_transparent
129-
public func _log(@autoclosure _ message: () -> String) {
129+
public func _log(@autoclosure _ message: ()->String) {
130130
print(message())
131131
}
132132

test/SILGen/implicitly_unwrapped_optional.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: %target-swift-frontend -emit-silgen %s | FileCheck %s
22

3-
func foo(f f: (() -> ())!) {
3+
func foo(f f: (()->())!) {
44
var f = f
55
f?()
66
}

test/SILGen/optional.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ func testCall(_ f: (() -> ())?) {
2323
// CHECK-NEXT: enum $Optional<()>, #Optional.none!enumelt
2424
// CHECK-NEXT: br bb2
2525

26-
func testAddrOnlyCallResult<T>(_ f: (() -> T)?) {
26+
func testAddrOnlyCallResult<T>(_ f: (()->T)?) {
2727
var f = f
2828
var x = f?()
2929
}

test/SourceKit/CursorInfo/cursor_info.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ class C3 {
7878
}
7979

8080
struct S2<T, U where T == U> {
81-
func foo<V, W where V == W> (_ closure: () -> ()) -> () -> () { return closure }
81+
func foo<V, W where V == W> (_ closure: ()->()) -> ()->() { return closure }
8282
}
8383
class C4<T, U where T == U> {}
8484
enum E1<T, U where T == U> {}
@@ -127,7 +127,7 @@ func genReq<U, V: P1 where V.T == U>(_ u: U, v: V) {}
127127
}
128128

129129
let tupleVar1: (((Int, Int), y: Int), z: Int)
130-
let tupleVar2: (f: () -> (), g: (x: Int) -> Int)
130+
let tupleVar2: (f: ()->(), g: (x: Int)->Int)
131131
let tupleVar3: (f: (inout x: (Int, Int)) throws ->(), Int)
132132

133133
enum E4: Int {
@@ -152,9 +152,9 @@ protocol P2: class, P1 {}
152152
typealias MyAlias<T, U> = (T, U, T, U)
153153
typealias MyAlias2<A, B> = MyAlias<A, B>
154154

155-
func paramAutoclosureNoescape1(@noescape _ msg: () -> String) {}
156-
func paramAutoclosureNoescape2(@autoclosure _ msg: () -> String) {}
157-
func paramAutoclosureNoescape3(@autoclosure(escaping) _ msg: () -> String) {}
155+
func paramAutoclosureNoescape1(@noescape _ msg: ()->String) {}
156+
func paramAutoclosureNoescape2(@autoclosure _ msg: ()->String) {}
157+
func paramAutoclosureNoescape3(@autoclosure(escaping) _ msg: ()->String) {}
158158

159159
func paramDefaultPlaceholder(_ f: StaticString = #function, file: StaticString = #file, line: UInt = #line, col: UInt = #column, arr: [Int] = [], dict: [Int:Int] = [:], opt: Int? = nil, reg: Int = 1) {}
160160

test/decl/typealias/typealias.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ typealias D<T1, T2, T3> = MyType<T2, T1> // expected-note {{'T3' declared as pa
7272

7373
typealias E<T1, T2> = Int // expected-note {{generic type 'E' declared here}}
7474

75-
typealias F<T1, T2> = T1 -> T2
75+
typealias F<T1, T2> = T1->T2
7676

7777
// Type alias of type alias.
7878
typealias G<S1, S2> = A<S1, S2>

validation-test/stdlib/OpenCLSDKOverlay.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ tests.test("clSetKernelArgsListAPPLE") {
130130
// Create the compute program from the source buffer
131131
//
132132
program = KernelSource.withCString {
133-
(p: UnsafePointer<CChar>) -> cl_program in
133+
(p: UnsafePointer<CChar>)->cl_program in
134134
var s: UnsafePointer? = p
135135
return withUnsafeMutablePointer(&s) {
136136
return clCreateProgramWithSource(context, 1, $0, nil, &err)

0 commit comments

Comments
 (0)