mirror of
https://github.com/logos-storage/questionable.git
synced 2026-01-02 13:53:11 +00:00
Better error message when adding a void result to a .? chain
This commit is contained in:
parent
dd9ac6dc20
commit
d18580bb68
@ -9,6 +9,8 @@ func expectSym(node: NimNode) =
|
||||
|
||||
template `.?`*(option: typed, identifier: untyped{nkIdent}): untyped =
|
||||
# chain is of shape: option.?identifier
|
||||
when not compiles(typeof(option.unsafeGet.identifier)):
|
||||
{.error: ".? chain cannot return void".}
|
||||
option ->? option.unsafeGet.identifier
|
||||
|
||||
macro `.?`*(option: typed, infix: untyped{nkInfix}): untyped =
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user