nim-lang / Nim

Nim is a statically typed compiled systems programming language. It combines successful concepts from mature languages like Python, Ada and Modula. Its design focuses on efficiency, expressiveness, and elegance (in that order of priority).
https://nim-lang.org
Other
16.46k stars 1.47k forks source link

ambiguous proc call causes `nim doc` to fail if `--warnings|hints:off` is set #21397

Closed noahehall closed 1 year ago

noahehall commented 1 year ago

Description

the good

the bad

Nim Version

$ nim -v
Nim Compiler Version 1.6.10 [Linux: amd64]
Compiled at 2022-11-21
Copyright (c) 2006-2021 by Andreas Rumpf

git hash: f1519259f85cbdf2d5ff617c6a5534fcd2ff6942
active boot switches: -d:release

Current Output

/home/poop/git/foss/nim/yolowurl/modules/tupleObjectTable.nim(394, 8) 
Error: ambiguous call; both yolowurl.collide(a: Thing, b: Unit) 
[method declared in /home/poop/git/foss/nim/yolowurl/modules/tupleObjectTable.nim(383, 8)]
 and yolowurl.collide(a: Unit, b: Thing) 
[method declared in /home/poop/git/foss/nim/yolowurl/modules/tupleObjectTable.nim(386, 8)] 
match for: (Unit, Unit)

Expected Output

I can disable hints/warnings and `nim doc ...` doesnt fail

Possible Solution

No response

Additional Information

# FYI: dont enable these, ambiguous calls fails docgen
# --warnings:off
# --hints:off
# --multimethods:on # has no effect

read -r -d '' doc_opts <<'EOF'
--verbosity:0
--docInternal
--index:on
--project
EOF

filepath=somefile.nim

nim doc -b:c $doc_opts $filepath
ire4ever1190 commented 1 year ago

Can't seem to reproduce

If I run without --multimethods:on it fails with the ambiguous error but using this command works

nim doc --multimethods:on --warnings:off --hints:off test.nim

Tried with both stable and devel

noahehall commented 1 year ago

@ire4ever1190 you are indeed correct, the htmldocs are still produced if i remove --multimethods:on