introduce internal Int128 type, use it to fix case stmt checks (#11652)
* initial version of int128 * use int128 in case stmt * fixes #11552
This commit is contained in:
parent
176eaf5c90
commit
7d5d9f7703
6 changed files with 550 additions and 11 deletions
|
|
@ -226,3 +226,14 @@ block tcasestm:
|
|||
true
|
||||
else: raise newException(ValueError, "Invalid")
|
||||
))
|
||||
|
||||
#issue #11552
|
||||
|
||||
proc positiveOrNegative(num: int): string =
|
||||
result = case num
|
||||
of (low(int)+2) .. -1:
|
||||
"negative"
|
||||
of 0:
|
||||
"zero"
|
||||
else:
|
||||
"impossible"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue