summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2013-03-21 08:09:14 +0100
committerAraq <rumpf_a@web.de>2013-03-21 08:09:14 +0100
commit02b1503e1f1d98206e743d0fe7eb24da5d28eb39 (patch)
tree5a7f79bb0b4972ac357a978d7744fa624998480f /tests
parentb7d19017477445b545f9be0e7038985106784787 (diff)
downloadNim-02b1503e1f1d98206e743d0fe7eb24da5d28eb39.tar.gz
bugfix: case exhaustiveness checking
Diffstat (limited to 'tests')
-rw-r--r--tests/reject/tcaseoverlaprange2.nim18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/reject/tcaseoverlaprange2.nim b/tests/reject/tcaseoverlaprange2.nim
new file mode 100644
index 000000000..d6e301508
--- /dev/null
+++ b/tests/reject/tcaseoverlaprange2.nim
@@ -0,0 +1,18 @@
+discard """
+  line: 13
+  errormsg: "duplicate case label"
+"""
+
+
+
+
+proc checkDuplicates(myval: int32): bool = 
+  case myval
+  of 0x7B:
+    echo "this should not compile"
+  of 0x78 .. 0x7D:
+    result = true
+  else:
+    nil
+
+echo checkDuplicates(0x7B)