fixes a regression about static object case variant checking

This commit is contained in:
Araq 2018-04-06 13:01:24 +02:00
commit 824092be31
2 changed files with 33 additions and 1 deletions

View file

@ -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