Alogani / asyncproc

Flexible child process spawner with strong async features
MIT License
11 stars 1 forks source link

Ambiguous indentifier error #15

Closed SolitudeSF closed 1 month ago

SolitudeSF commented 1 month ago

compiling included test results in

/home/solitude/.nimble/pkgs2/asyncproc-0.4.2-ee4d0d55c032f3713dd75325f392336f86a088f6/asyncproc/exports/asyncprocimpl.nim(212, 48) template/generic instantiation of `async` from here
/home/solitude/.nimble/pkgs2/asyncproc-0.4.2-ee4d0d55c032f3713dd75325f392336f86a088f6/asyncproc/exports/asyncprocimpl.nim(218, 15) Error: ambiguous identifier: 'MergeStderr' -- use one of the following:
  ProcOption.MergeStderr: ProcOption
  BuilderFlags.MergeStderr: BuilderFlags
Alogani commented 1 month ago

Hello,

It's strange, it doesn't happen in my side. Are you using nim v2.0.2 ?

I will modify BuilderFlags.MergeStderr, this will resolve the problem (i intended to move this code section either way)

Alogani commented 1 month ago

In fact, that is rather strange it worked in my side after looking at the problem :-D

Last version should fix it, please let me now if it doesn't

SolitudeSF commented 1 month ago

it does fix it. im using devel. it is strange, i would imagine enum overloading should take care of this.

Alogani commented 1 month ago

Cool it works.

It is bad design on my part, so in fact nim devel might be right. Having both ProcOption.MergeStderr and BuilderFlags.MergeStderr is quite bad.

But with {.pure.} pragma, it is better acceptable.

(I have also used similar enums in my shellcmd project, so you might encounter same problem)

SolitudeSF commented 1 month ago

no, devel is wrong, it is a regression. and pure should be deprecated.

SolitudeSF commented 1 month ago

Filed an issue, if you are interested https://github.com/nim-lang/Nim/issues/23579

SolitudeSF commented 1 month ago

its complicated. it only works on stable because of the order of the declaration of your enums.

Alogani commented 1 month ago

I see, I will make attention to this next time I overload enums

Thanks for the info !