codex-storage / questionable

Elegant optional types for Nim
Other
115 stars 5 forks source link

Fix: `without` statement with error in nested calls #21

Closed markspanbroek closed 2 years ago

markspanbroek commented 2 years ago

Having nested calls using without statements could sometimes fail.

Example:

proc bar(): ?!int =
  without _ =? int.failure "error", err:
    return failure err.msg

proc foo() =
  without _ =? bar(), err:
    # err is nil here!

Fixes a part of #19.