SciNim / nimcuda

Nim bindings for CUDA
Apache License 2.0
42 stars 9 forks source link

nimcuda.nimble(26, 20) Error: ambiguous call #12

Closed narimiran closed 1 year ago

narimiran commented 2 years ago

Nim CIs for Nim 1.2 have reported:

nimcuda.nimble(26, 20) Error: ambiguous call; both system.fileExists(filename: string) [declared in /home/vsts/work/1/s/lib/system/nimscript.nim(130, 6)] and os.fileExists(filename: string) [declared in /home/vsts/work/1/s/lib/pure/os.nim(1138, 6)] match for: (string)

(It is not a problem with Nim 1.6 nor Nim devel)


I'm guessing, this started after this commit: https://github.com/andreaferretti/nimcuda/commit/5735fed30436083da01ca9aa0f7019f5a17939d5

andreaferretti commented 2 years ago

I see. One could try to support both, but maybe it does not make sense? How many people are still using 1.2?

narimiran commented 2 years ago

How many people are still using 1.2?

According to the 2021 survey — just a few. But there are packages which use nimcuda (e.g. Arraymancer), that might want to keep the 1.2 support.

Maybe something like this would work (haven't tested it):

when (NimMajor, NimMinor) < (1, 4):
  import os except fileExists
else:
  import os