c-blake / cligen

Nim library to infer/generate command-line-interfaces / option / argument parsing; Docs at
https://c-blake.github.io/cligen/
ISC License
508 stars 24 forks source link

Error: overloaded 'dispatchcount' leads to ambiguous calls #168

Closed pb-cdunn closed 3 years ago

pb-cdunn commented 3 years ago
/Users/cdunn/repo/gh/hack/nibsv/nimbleDir/pkgs/cligen-1.2.2/cligen.nim(663, 12) Error: overloaded 'dispatchcount' leads to ambiguous calls

That happens when I add a single line: `diff --- src/nib.nim +++ src/nib.nim @@ -1,9 +1,11 @@ from nibpkg/compose import nil from nibpkg/refmers import nil +from nibpkg/mainLookup import nil

when isMainModule: import cligen dispatchMulti( [compose.compose_variants, cmdName="compose"], [refmers.countRefKmers, cmdName="count"],

pb-cdunn commented 3 years ago

Never mind. Forgot to change cmdName.

pb-cdunn commented 3 years ago

I guess a better help msg would be good though. :smile:

c-blake commented 3 years ago

Hmm. It might be possible for me to put all the dispatchers into a Table with some already-used slot protocol for such errors. "Already used" and "ambiguous call" are preeeeetty similar, though. So, I'm not sure the value add would be justified. To the extent it would add value, better messages from the Nim compiler itself seems higher impact. Good luck on your hackathon. :-)

pb-cdunn commented 3 years ago

Good point.