Good day!
I was mastering Modules in tutorial and wondering why call of ambiguous proc works fine:
# Module A
proc toStr*(arg: int): string = $arg
# Module B
proc toStr*(arg: string): string = $arg
# Module C (main)
import moduleA, moduleB
# not ambiguous: overloaded moduleA.toStr(int) is called:
echo(toStr(42)) # --> 42
# not ambiguous: overloaded moduleB.toStr(string) is called:
echo(toStr("alpha!")) # --> alpha!
proc toStr*(arg: string): string = nil
# according to tutorial, should be ambiguous but moduleC.toStr(string) is called:
echo(toStr("bravo!")) # --> nil
Tutorial issue?