From 7d5d9f7703901e092422d682f7ab21995cfa1122 Mon Sep 17 00:00:00 2001 From: Arne Döring Date: Fri, 5 Jul 2019 22:45:32 +0200 Subject: introduce internal Int128 type, use it to fix case stmt checks (#11652) * initial version of int128 * use int128 in case stmt * fixes #11552 --- tests/casestmt/tcasestmt.nim | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tests') diff --git a/tests/casestmt/tcasestmt.nim b/tests/casestmt/tcasestmt.nim index 465080e84..d86b3b0dd 100644 --- a/tests/casestmt/tcasestmt.nim +++ b/tests/casestmt/tcasestmt.nim @@ -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" -- cgit 1.4.1-2-gfad0