Is there a reason why I can use a generic function with different type arguments when I pass it as a local value but not when passed as parameter? For example:
I guess this is the expected behaviour:
In the first case you call two different versions of f (one with int, one with char), in the second case you use the same for both and the compiler infers it (top-bottom, left-right - remember?) to be int->int
The problem is that the generic version will be translated in a concrete one by the compiler. I see no workaround for this - not even with inline but perhaps someone can work some magic here ;)