mirror of
https://github.com/logos-storage/questionable.git
synced 2026-01-02 13:53:11 +00:00
Fix redefinition of 'T`gensymXX' error
In rare instances, the Nim compiler will generate the same symbol more than once. Adding a block works around this issue. Reproducing this behavior in a unit test has proved elusive.
This commit is contained in:
parent
30e4184a99
commit
f78bdd9d58
@ -4,8 +4,9 @@ macro `.?`*(expression: typed, brackets: untyped{nkBracket}): untyped =
|
||||
# chain is of shape: expression.?[index]
|
||||
let index = brackets[0]
|
||||
quote do:
|
||||
type T = typeof(`expression`[`index`])
|
||||
try:
|
||||
`expression`[`index`].some
|
||||
except KeyError:
|
||||
T.none
|
||||
block:
|
||||
type T = typeof(`expression`[`index`])
|
||||
try:
|
||||
`expression`[`index`].some
|
||||
except KeyError:
|
||||
T.none
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user