summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2018-04-06 13:01:24 +0200
committerAraq <rumpf_a@web.de>2018-04-06 13:01:24 +0200
commit824092be312ff16445f137c4322d0cd3cc95fb2e (patch)
tree7bcbf377b6df89c7a438aaf1a9964fca6a8fabe4 /compiler
parent0872e7a27e08c551f21cfcf3f8963f6f452f62cf (diff)
downloadNim-824092be312ff16445f137c4322d0cd3cc95fb2e.tar.gz
fixes a regression about static object case variant checking
Diffstat (limited to 'compiler')
-rw-r--r--compiler/semobjconstr.nim4
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/semobjconstr.nim b/compiler/semobjconstr.nim
index e2296a0d2..cfa0fbd05 100644
--- a/compiler/semobjconstr.nim
+++ b/compiler/semobjconstr.nim
@@ -77,7 +77,9 @@ proc semConstrField(c: PContext, flags: TExprFlags,
 
 proc caseBranchMatchesExpr(branch, matched: PNode): bool =
   for i in 0 .. branch.len-2:
-    if exprStructuralEquivalent(branch[i], matched):
+    if branch[i].kind == nkRange:
+      if overlap(branch[i], matched): return true
+    elif exprStructuralEquivalent(branch[i], matched):
       return true
 
   return false