I want to the following code to prove “A is not B”:
trait IsNot[A, B]
object IsNot:
given xorA[A, B]: IsNot[A, B] with {}
given xorB[A, B](using proof: A =:= B): IsNot[A, B] with {}
But the following code pass the compilation:
summon[IsNot[Int, Int]]
I thought the compiler should complain it with “Ambiguous given instances”.
What is wrong with my above code?
Thanks for your help!
Guofeng