cats
cats copied to clipboard
Ambiguous Vector instances
The implicits catsKernelStdPartialOrderForVector and catsKernelStdHashForVector (here) are ambiguous if A has both PartialOrder and Hash instances, and we're looking for an Eq[Vector[A]]. (List seems to have the same problem.)
I am not sure if we can fix it for Scala 2.11 without breaking BC. We might have to leave it as is on 2.11 and do a scala version specific fix for 2.12+. Or we simply drop 2.11 which is more likely now than before.
The fix in #3100 ended up breaking bincompat (MiMa missed it), so we had to revert it for now.
Hi! I tried to replicate this error in Scala212, Scala213 and Scala3 with the following script:
import cats._
type A = String // tried also with Int, List[Int]
// checked that A has a both instances
implicitly(PartialOrder[A])
implicitly(Hash[A])
// replicate implicit ambiguity error
implicitly(Eq[Vector[A]])
implicitly(Eq[List[A]])
And got successful executions every time. Let me know if there is another situation that breaks, but otherwise the issue could be closed.
Thanks!