Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
distinct generic typeclass not treated as distinct #4435
The distinct generic types A[T] and B[T] are not treated as distinct when used as typeclasses. Using them with the generic parameter still works though. This code works in 0.13.
type A[T] = distinct T B[T] = distinct T proc foo[T](x:A[T]) = echo "A" proc foo[T](x:B[T]) = echo "B" proc bar(x:A) = echo "A" proc bar(x:B) = echo "B" var a:A[int] foo(a) # fine bar(a) # testdistinct.nim(14, 4) Error: ambiguous call; both testdistinct.bar(x: A) and testdistinct.bar(x: B) match for: (A[system.int])