From 87c9bda419debd1f3722bccffbf2e72292b40c7a Mon Sep 17 00:00:00 2001 From: Edmund Noble Date: Thu, 29 Jun 2017 16:24:21 -0400 Subject: [PATCH] Make ambiguity test better --- tests/src/test/scala/cats/tests/OrderTests.scala | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/src/test/scala/cats/tests/OrderTests.scala b/tests/src/test/scala/cats/tests/OrderTests.scala index e319a4b9223..1b068796b2f 100644 --- a/tests/src/test/scala/cats/tests/OrderTests.scala +++ b/tests/src/test/scala/cats/tests/OrderTests.scala @@ -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] + } }