Skip to content

Commit 9721dec

Browse files
committed
Add another test for @_implements when calling from a generic context.
1 parent bc9c876 commit 9721dec

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

test/attr/attr_implements_fp.swift

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@ public func compare_Comparables<T:Comparable>(_ x: T, _ y: T) -> Bool {
8989
return x < y
9090
}
9191

92+
public func compare_FauxtingPoint<T:FauxtingPoint>(_ x: T, _ y: T) -> Bool {
93+
return x < y
94+
}
95+
9296
public func compare_Fauxts(_ x: Fauxt, _ y: Fauxt) -> Bool {
9397
return x < y
9498
}
@@ -104,6 +108,16 @@ public func main() {
104108
assert(comparedAsComparablesCount == 3)
105109
// CHECK: compared as Comparables
106110

111+
assert(compare_FauxtingPoint(Fauxt.one, Fauxt.two))
112+
assert(comparedAsComparablesCount == 4)
113+
// CHECK: compared as Comparables
114+
assert(compare_FauxtingPoint(Fauxt.one, Fauxt.nan))
115+
assert(comparedAsComparablesCount == 5)
116+
// CHECK: compared as Comparables
117+
assert(!compare_FauxtingPoint(Fauxt.nan, Fauxt.one))
118+
assert(comparedAsComparablesCount == 6)
119+
// CHECK: compared as Comparables
120+
107121
assert(compare_Fauxts(Fauxt.one, Fauxt.two))
108122
assert(comparedAsFauxtsCount == 1)
109123
// CHECK: compared as Fauxts

0 commit comments

Comments
 (0)