Skip to content

Commit

Permalink
Make ambiguity test better
Browse files Browse the repository at this point in the history
  • Loading branch information
edmundnoble committed Jun 29, 2017
1 parent ed8c873 commit 87c9bda
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/src/test/scala/cats/tests/OrderTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,16 @@ class OrderTests extends FunSuite {
Invariant[Order]
Contravariant[Order]
}

// ambiguity test:
// the Ordering instance from the Order instance should be trumped
// by the one provided in the Ordering companion object
{
import cats.instances.all._
Ordering[String]
class C
implicit val ording: Ordering[C] = (_: C, _: C) => 0
implicit val ord: Order[C] = Order.allEqual
Ordering[C]
}
}

0 comments on commit 87c9bda

Please sign in to comment.