This commit is contained in:
Araq
2015-04-08 15:13:58 +02:00
parent 4b382940f0
commit 2176ea759f
2 changed files with 10 additions and 1 deletions

View File

@@ -1587,7 +1587,7 @@ proc genRangeChck(p: BProc, n: PNode, d: var TLoc, magic: string) =
[getTypeDesc(p.module, dest), rdCharLoc(a)])
else:
initLocExpr(p, n.sons[0], a)
if leValue(n.sons[2], n.sons[1]):
if not leValue(n.sons[1], n.sons[2]):
internalError(n.info, "range check will always fail; empty range")
putIntoDest(p, d, dest, ropecg(p.module, "(($1)#$5($2, $3, $4))", [
getTypeDesc(p.module, dest), rdCharLoc(a),

View File

@@ -0,0 +1,9 @@
discard """
output: '''true'''
"""
# bug #2489
let a = [1]
let b = [1]
echo a == b