bugfix: case exhaustiveness checking

This commit is contained in:
Araq 2013-03-21 08:09:14 +01:00
commit 02b1503e1f
5 changed files with 27 additions and 6 deletions

View file

@ -44,9 +44,9 @@ proc inSet(s: PNode, elem: PNode): bool =
return true
result = false
proc overlap(a, b: PNode): bool =
if a.kind == nkRange:
if b.kind == nkRange:
proc overlap(a, b: PNode): bool =
if a.kind == nkRange:
if b.kind == nkRange:
# X..Y and C..D overlap iff (X <= D and C <= Y)
result = leValue(a.sons[0], b.sons[1]) and
leValue(b.sons[0], a.sons[1])