13
13
public var comparedAsCauxmparablesCount : Int = 0
14
14
public var comparedAsFauxtsCount : Int = 0
15
15
16
+ infix operator .< : ComparisonPrecedence
17
+
16
18
public protocol Cauxmparable {
17
- static func < ( lhs: Self , rhs: Self ) -> Bool
19
+ static func . < ( lhs: Self , rhs: Self ) -> Bool
18
20
}
19
21
20
22
public protocol FauxtingPoint : Cauxmparable {
@@ -28,8 +30,8 @@ public protocol BinaryFauxtingPoint: FauxtingPoint {
28
30
}
29
31
30
32
public extension BinaryFauxtingPoint {
31
- // This version of < will be called in a context that only knows it has a Cauxmparable.
32
- @_implements ( Cauxmparable, < ( _: _: ) )
33
+ // This version of . < will be called in a context that only knows it has a Cauxmparable.
34
+ @_implements ( Cauxmparable, . < ( _: _: ) )
33
35
static func _CauxmparableLessThan( _ lhs: Fauxt , _ rhs: Fauxt ) -> Bool {
34
36
print ( " compared as Cauxmparables " )
35
37
comparedAsCauxmparablesCount += 1
@@ -74,11 +76,11 @@ extension Fauxt: BinaryFauxtingPoint {
74
76
}
75
77
76
78
public extension Fauxt {
77
- // This version of < will be called in a context that knows it has a Fauxt.
79
+ // This version of . < will be called in a context that knows it has a Fauxt.
78
80
// It is inside an extension of Fauxt rather than the declaration of Fauxt
79
81
// itself in order to avoid a warning about near-matches with the defaulted
80
- // requirement from Cauxmparable.< up above.
81
- static func < ( _ lhs: Fauxt , _ rhs: Fauxt ) -> Bool {
82
+ // requirement from Cauxmparable.. < up above.
83
+ static func . < ( _ lhs: Fauxt , _ rhs: Fauxt ) -> Bool {
82
84
print ( " compared as Fauxts " )
83
85
comparedAsFauxtsCount += 1
84
86
if lhs. state == . Nan || rhs. state == . Nan {
@@ -90,15 +92,15 @@ public extension Fauxt {
90
92
}
91
93
92
94
public func compare_Cauxmparables< T: Cauxmparable > ( _ x: T , _ y: T ) -> Bool {
93
- return x < y
95
+ return x . < y
94
96
}
95
97
96
98
public func compare_FauxtingPoint< T: FauxtingPoint > ( _ x: T , _ y: T ) -> Bool {
97
- return x < y
99
+ return x . < y
98
100
}
99
101
100
102
public func compare_Fauxts( _ x: Fauxt , _ y: Fauxt ) -> Bool {
101
- return x < y
103
+ return x . < y
102
104
}
103
105
104
106
public func main( ) {
0 commit comments