mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-01 10:52:14 +00:00
fixes #2489
This commit is contained in:
@@ -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),
|
||||
|
||||
9
tests/ccgbugs/tarray_equality.nim
Normal file
9
tests/ccgbugs/tarray_equality.nim
Normal file
@@ -0,0 +1,9 @@
|
||||
discard """
|
||||
output: '''true'''
|
||||
"""
|
||||
|
||||
# bug #2489
|
||||
|
||||
let a = [1]
|
||||
let b = [1]
|
||||
echo a == b
|
||||
Reference in New Issue
Block a user