Created
May 18, 2020 17:51
-
-
Save bbarker/82a166f20e2a133987e637b3caf4e973 to your computer and use it in GitHub Desktop.
Modeling Assertion Errors
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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