summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
Diffstat (limited to 'compiler')
-rw-r--r--compiler/semtypes.nim2
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim
index 8cba88747..6302a4590 100644
--- a/compiler/semtypes.nim
+++ b/compiler/semtypes.nim
@@ -619,6 +619,8 @@ proc semCaseBranch(c: PContext, n, branch: PNode, branchIndex: int,
     var b = branch[i]
     if b.kind == nkRange:
       branch[i] = b
+      # same check as in semBranchRange for exhaustiveness
+      covered = covered + getOrdValue(b[1]) + 1 - getOrdValue(b[0])
     elif isRange(b):
       branch[i] = semCaseBranchRange(c, n, b, covered)
     else: