Skip to content

Commit 8d3f887

Browse files
committed
Add parens to the few cases in the stdlib that lack them for function types.
1 parent 180098e commit 8d3f887

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

stdlib/internal/SwiftExperimental/SwiftExperimental.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ infix operator ∘ {
3939
///
4040
/// - Returns: a function that applies ``g`` to the result of applying ``f``
4141
/// to the argument of the new function.
42-
public func <T, U, V>(g: U -> V, f: T -> U) -> (T -> V) {
42+
public func <T, U, V>(g: (U) -> V, f: (T) -> U) -> ((T) -> V) {
4343
return { g(f($0)) }
4444
}
4545

stdlib/private/StdlibUnittest/StdlibUnittest.swift.gyb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2271,8 +2271,8 @@ public func expectEqualsUnordered<
22712271
}
22722272

22732273
public func expectEqualFunctionsForDomain<ArgumentType, Result : Equatable>(
2274-
_ arguments: [ArgumentType], _ function1: ArgumentType -> Result,
2275-
_ function2: ArgumentType -> Result
2274+
_ arguments: [ArgumentType], _ function1: (ArgumentType) -> Result,
2275+
_ function2: (ArgumentType) -> Result
22762276
) {
22772277
for a in arguments {
22782278
let expected = function1(a)
@@ -2285,8 +2285,8 @@ public func expectEqualMethodsForDomain<
22852285
SelfType, ArgumentType, Result : Equatable
22862286
>(
22872287
_ selfs: [SelfType], _ arguments: [ArgumentType],
2288-
_ function1: SelfType -> ArgumentType -> Result,
2289-
_ function2: SelfType -> ArgumentType -> Result
2288+
_ function1: (SelfType) -> (ArgumentType) -> Result,
2289+
_ function2: (SelfType) -> (ArgumentType) -> Result
22902290
) {
22912291
for s in selfs {
22922292
for a in arguments {
@@ -2313,7 +2313,7 @@ public func expectEqualUnicodeScalars(
23132313
}
23142314
}
23152315

2316-
func compose<A, B, C>(_ f: A -> B, _ g: B -> C) -> A -> C {
2316+
func compose<A, B, C>(_ f: (A) -> B, _ g: (B) -> C) -> (A) -> C {
23172317
return { a in
23182318
return g(f(a))
23192319
}

0 commit comments

Comments
 (0)