The following example does not compile due to an ambiguous call error.
I don't understand why, since the T:SomeInteger version fits better than the generic version
proc foo[T](A:openArray[T]) =
echo "Generic version"
echo A
proc foo[T:SomeInteger](A:openArray[T]) =
echo "SomeInteger version"
echo A
var
A = [7,4,6,3,9,1]
foo(A)
As I've mentioned in previous threads, please don't create so much threads in such a short amount of time.
Your question is answered by https://nim-lang.org/docs/manual.html#overloading-resolution
How about this sentence (from the manual)
Likewise for generic matches the most specialized generic type (that still matches) is preferred:
For me that should prefer the T:SomeInteger version.
T and T are both generics. You need to use disambiguation like that:
proc foo[T: not SomeInteger](A:openArray[T]) =
echo "Generic version"
echo A
proc foo[T:SomeInteger](A:openArray[T]) =
echo "SomeInteger version"
echo A