-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import os + use of existsDir/dirExists/existsFile/fileExists/findExe in config.nims causes "ambiguous call' error #14142
Comments
…dirExists/existsFile/fileExists/findExe in config.nims
reduced example: # foo.nim
import os
echo dirExists("/tmp")
when ? 1.0.0 gives same error and 0.19.0 gives however, this is annoying so I'm (hopefully) fixing it here: #14143 |
Also getEnv, existsEnv, putEnv, delEnv, getCurrentDir. The following procs are also the same idea in os and nimscript but are renamed: removeDir -> rmDir, removeFile -> rmFile, moveDir -> mvDir, moveFile -> mvFile, createDir -> mkDir, copyFile -> cpFile, copyDir -> cpDir. |
They are renamed for a reason! |
Yes, I advocate for that. I don't think any procs should be deleted from nimscript, I just think they should be moved to |
The |
…dirExists/existsFile/fileExists/findExe in config.nims
I think my fix mostly works. :-) |
…dirExists/existsFile/fileExists/findExe in config.nims
…dirExists/existsFile/fileExists/findExe in config.nims
* fix #14142: no more clash with: import os + use of existsDir/dirExists/existsFile/fileExists/findExe in config.nims * remove a comment * Revert "fixes the regression #12860 caused; hotfix" This reverts commit 3d2459b. * Revert "Undefine `paramCount` & `paramStr` in nimscript.nim for *.nims (#12860)" This reverts commit d38853c. * noNimScript => noWeirdTarget + noNimJs
.. after nim-lang/Nim#14142 got fixed.
In
config.nims
, when theos
module is imported and one of these procs are used:existsDir
ordirExists
existsFile
orfileExists
findExe
we get the "ambiguous call" error (because these are defined in both
system
andos
.Example
config.nims
config.nims
in any directorynim temp123
Current Output
Expected Output
Outputs of the echo statements in the above example.
Workaround
import os except existsDir, dirExists, existsFile, fileExists, findExe
, orsystem.
qualifiers with the ambiguous identifiers.Additional Information
This issue is very closely related to #12835 .
This used to work at some point (probably around Nim 19.x).
The text was updated successfully, but these errors were encountered: