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…
Reference in New Issue