mirror of
https://github.com/logos-storage/questionable.git
synced 2026-01-05 23:33:12 +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
ab56220011
@ -4,8 +4,9 @@ macro `.?`*(expression: typed, brackets: untyped{nkBracket}): untyped =
|
|||||||
# chain is of shape: expression.?[index]
|
# chain is of shape: expression.?[index]
|
||||||
let index = brackets[0]
|
let index = brackets[0]
|
||||||
quote do:
|
quote do:
|
||||||
type T = typeof(`expression`[`index`])
|
block:
|
||||||
try:
|
type T = typeof(`expression`[`index`])
|
||||||
`expression`[`index`].some
|
try:
|
||||||
except KeyError:
|
`expression`[`index`].some
|
||||||
T.none
|
except KeyError:
|
||||||
|
T.none
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user