Type error in generic converter always results in failure, even if there is better matching converter. Is this intended?
converter conv2(a: any): int =
let s: float = a
return 5
converter conv1(a: string): int =
return 10
let a: int = "foo"
I am not an expert in C++ SFINAE constructs, but as far as I know they rely heavily on template metaprogramming, which is by design not supported by Nim. Nim has macros that can do metaprogramming much easier.
But what you are describing has nothing to do with SFINAE, just overload resolution rules. There are two converter methods available that can convert the string into an int, one takes an int, and the other one takes an any, where the string needs to be converted first, and I think it's a valid request, that in this context the conv1 procedure should be prioritized over conv2. This would also match better the c++ overload resolution for function calls.