Skip to content

Commit 410afe8

Browse files
authored
Workaround for #34 (#35)
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!
1 parent 8a03fb2 commit 410afe8

File tree

3 files changed

+416
-118
lines changed

3 files changed

+416
-118
lines changed

0 commit comments

Comments
 (0)