Skip to content

Commit 8b28790

Browse files
committed
Rename Cauxmparables requirement from '<' to '.<' in an @_implements test.
1 parent 556d8f1 commit 8b28790

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

test/attr/attr_implements_fp.swift

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@
1313
public var comparedAsCauxmparablesCount : Int = 0
1414
public var comparedAsFauxtsCount : Int = 0
1515

16+
infix operator .< : ComparisonPrecedence
17+
1618
public protocol Cauxmparable {
17-
static func < (lhs: Self, rhs: Self) -> Bool
19+
static func .< (lhs: Self, rhs: Self) -> Bool
1820
}
1921

2022
public protocol FauxtingPoint : Cauxmparable {
@@ -28,8 +30,8 @@ public protocol BinaryFauxtingPoint: FauxtingPoint {
2830
}
2931

3032
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, .<(_:_:))
3335
static func _CauxmparableLessThan(_ lhs: Fauxt, _ rhs: Fauxt) -> Bool {
3436
print("compared as Cauxmparables")
3537
comparedAsCauxmparablesCount += 1
@@ -74,11 +76,11 @@ extension Fauxt: BinaryFauxtingPoint {
7476
}
7577

7678
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.
7880
// It is inside an extension of Fauxt rather than the declaration of Fauxt
7981
// 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 {
8284
print("compared as Fauxts")
8385
comparedAsFauxtsCount += 1
8486
if lhs.state == .Nan || rhs.state == .Nan {
@@ -90,15 +92,15 @@ public extension Fauxt {
9092
}
9193

9294
public func compare_Cauxmparables<T:Cauxmparable>(_ x: T, _ y: T) -> Bool {
93-
return x < y
95+
return x .< y
9496
}
9597

9698
public func compare_FauxtingPoint<T:FauxtingPoint>(_ x: T, _ y: T) -> Bool {
97-
return x < y
99+
return x .< y
98100
}
99101

100102
public func compare_Fauxts(_ x: Fauxt, _ y: Fauxt) -> Bool {
101-
return x < y
103+
return x .< y
102104
}
103105

104106
public func main() {

0 commit comments

Comments
 (0)