Skip to content

Commit f9e5406

Browse files
authored
Merge pull request swiftlang#36116 from CodaFi/members-only-club
Use Member Operators in StdlibUnitTest
2 parents 7d39908 + f9a5c29 commit f9e5406

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

stdlib/private/StdlibUnittest/StdlibCoreExtras.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,14 +128,14 @@ public struct TypeIdentifier : Hashable, Comparable {
128128
internal var objectID : ObjectIdentifier {
129129
return ObjectIdentifier(value)
130130
}
131-
}
132131

133-
public func < (lhs: TypeIdentifier, rhs: TypeIdentifier) -> Bool {
134-
return lhs.objectID < rhs.objectID
135-
}
132+
public static func < (lhs: TypeIdentifier, rhs: TypeIdentifier) -> Bool {
133+
return lhs.objectID < rhs.objectID
134+
}
136135

137-
public func == (lhs: TypeIdentifier, rhs: TypeIdentifier) -> Bool {
138-
return lhs.objectID == rhs.objectID
136+
public static func == (lhs: TypeIdentifier, rhs: TypeIdentifier) -> Bool {
137+
return lhs.objectID == rhs.objectID
138+
}
139139
}
140140

141141
extension TypeIdentifier

stdlib/private/StdlibUnittest/StdlibUnittest.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3034,15 +3034,15 @@ struct Pair<T : Comparable> : Comparable {
30343034

30353035
var first: T
30363036
var second: T
3037-
}
30383037

3039-
func == <T>(lhs: Pair<T>, rhs: Pair<T>) -> Bool {
3040-
return lhs.first == rhs.first && lhs.second == rhs.second
3041-
}
3038+
static func == <T>(lhs: Pair<T>, rhs: Pair<T>) -> Bool {
3039+
return lhs.first == rhs.first && lhs.second == rhs.second
3040+
}
30423041

3043-
func < <T>(lhs: Pair<T>, rhs: Pair<T>) -> Bool {
3044-
return [lhs.first, lhs.second].lexicographicallyPrecedes(
3045-
[rhs.first, rhs.second])
3042+
static func < <T>(lhs: Pair<T>, rhs: Pair<T>) -> Bool {
3043+
return [lhs.first, lhs.second].lexicographicallyPrecedes(
3044+
[rhs.first, rhs.second])
3045+
}
30463046
}
30473047

30483048
public func expectEqualsUnordered<

0 commit comments

Comments
 (0)