diff --git a/questionable/chaining.nim b/questionable/chaining.nim index 7c8ca14..3373a0d 100644 --- a/questionable/chaining.nim +++ b/questionable/chaining.nim @@ -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 =