mixin
'd pre-existing symbols only work as expected in calls
#20240
Labels
mixin
'd pre-existing symbols only work as expected in calls
#20240
What happened?
This example using the
mixin
keyword works as expected:While this one does not, with the only change being that a proc named
doThing
already exists whengetDoThing
is defined:I also tried using a template I named
coerce
to encourage it to pick the correct symbol, but then it seems to only consider symbols defined at definition:Nim Version
Nim Compiler Version 1.6.6 [Linux: amd64]
Compiled at 2022-05-05
Copyright (c) 2006-2021 by Andreas Rumpf
git hash: 0565a70
active boot switches: -d:release
Current Standard Output Logs
No response
Expected Standard Output Logs
No response
Possible Solution
I'm not very familiar how the compiler works, but I expect
mixin
to work something like the experimentaldynamicBindSym
feature?I briefly tested it across modules as well, and it seems to work as
mixin
should, except in the case that you want an un-exported symbol to be part of theOpenSymChoice
.Additional Information
Although the example given isn't the most practical, I ran into this issue myself when trying to create a vtable for a given type by grabbing overloaded procs of certain names, similar to https://github.com/andreaferretti/interfaced.
Apologies if this bug report isn't very clear or comprehensive, this is my first time doing this, and I'm incredibly sleepy at the moment.
The text was updated successfully, but these errors were encountered: