Skip to content

Commit

Permalink
Fixes ambiguity errors when evaluating Nimble files. (nim-lang#12674)…
Browse files Browse the repository at this point in the history
… [backport]

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: ()
```

(cherry picked from commit bab5351)
  • Loading branch information
dom96 authored and narimiran committed Nov 18, 2019
1 parent f3e088f commit 5937c40
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 @@ -227,9 +227,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 @@ -264,9 +264,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 5937c40

Please sign in to comment.