You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR adds a workaround for the case where a global symbol is matched instead of the local `error`/`value` template in `valueOr` and friends, when `valueOr` is being used in a generic context.
Two options are added:
* when using Nim version supporting the experimental `genericsOpenSym` [feature](nim-lang/Nim#23873), we use it
* when not, a macro tries to replace all accesses in the given body with the correct symbol - this matching is done by name and some minimal heuristics which potentially could be wrong - the upstream solution is obviously preferable
Both solutions can be disabled via compile-time options to retain the old behavior of matching the global symbol.
See also nim-lang/Nim#22605
thanks to @Araq for the macro hack and @metagn for the language fix!
0 commit comments