Skip to content

Instantly share code, notes, and snippets.

@bbarker
Created May 18, 2020 17:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bbarker/82a166f20e2a133987e637b3caf4e973 to your computer and use it in GitHub Desktop.
Save bbarker/82a166f20e2a133987e637b3caf4e973 to your computer and use it in GitHub Desktop.
Modeling Assertion Errors
func sumTillNegative(x: varargs[int]): int {.raises: [].} =
for i in x:
if i >= 0:
result = result + i
assert result == (result - 1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment