Skip to content

Commit

Permalink
Fixes ambiguity errors when evaluating Nimble files. (#12674) [backport]
Browse files Browse the repository at this point in the history
When trying to evaluate a Nimble file which imports a Nim module
I was getting the following errors for some reason:

```
/Users/dom/projects/nim/lib/pure/parseopt.nim(229, 46) Error: ambiguous call; both system.paramCount() [declared in /Users/dom/projects/nim/lib/system/nimscript.nim(65, 6)] and os.paramCount() [declared in /Users/dom/projects/nim/lib/pure/os.nim(2613, 8)] match for: ()
```
  • Loading branch information
dom96 authored and Araq committed Nov 18, 2019
1 parent 223e65e commit bab5351
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/pure/parseopt.nim
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,9 @@ when declared(os.paramCount):
if cmdline != "":
result.cmds = parseCmdLine(cmdline)
else:
result.cmds = newSeq[string](paramCount())
for i in countup(1, paramCount()):
result.cmds[i-1] = paramStr(i).string
result.cmds = newSeq[string](os.paramCount())
for i in countup(1, os.paramCount()):
result.cmds[i-1] = os.paramStr(i).string

result.kind = cmdEnd
result.key = TaintedString""
Expand Down Expand Up @@ -263,9 +263,9 @@ when declared(os.paramCount):
for i in 0..<cmdline.len:
result.cmds[i] = cmdline[i].string
else:
result.cmds = newSeq[string](paramCount())
for i in countup(1, paramCount()):
result.cmds[i-1] = paramStr(i).string
result.cmds = newSeq[string](os.paramCount())
for i in countup(1, os.paramCount()):
result.cmds[i-1] = os.paramStr(i).string
result.kind = cmdEnd
result.key = TaintedString""
result.val = TaintedString""
Expand Down

0 comments on commit bab5351

Please sign in to comment.