forked from M-Labs/artiq
compiler: Fix comparison of tuples of lists
This commit is contained in:
parent
baf102dbb2
commit
990e0b7dd9
|
@ -1426,7 +1426,7 @@ class ARTIQIRGenerator(algorithm.Visitor):
|
||||||
for index in range(len(lhs.type.elts)):
|
for index in range(len(lhs.type.elts)):
|
||||||
lhs_elt = self.append(ir.GetAttr(lhs, index))
|
lhs_elt = self.append(ir.GetAttr(lhs, index))
|
||||||
rhs_elt = self.append(ir.GetAttr(rhs, index))
|
rhs_elt = self.append(ir.GetAttr(rhs, index))
|
||||||
elt_result = self.append(ir.Compare(op, lhs_elt, rhs_elt))
|
elt_result = self.polymorphic_compare_pair(op, lhs_elt, rhs_elt)
|
||||||
if result is None:
|
if result is None:
|
||||||
result = elt_result
|
result = elt_result
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -5,3 +5,9 @@ x, y = 2, 1
|
||||||
x, y = y, x
|
x, y = y, x
|
||||||
assert x == 1 and y == 2
|
assert x == 1 and y == 2
|
||||||
assert (1, 2) + (3.0,) == (1, 2, 3.0)
|
assert (1, 2) + (3.0,) == (1, 2, 3.0)
|
||||||
|
|
||||||
|
assert (0,) == (0,)
|
||||||
|
assert (0,) != (1,)
|
||||||
|
|
||||||
|
assert ([0],) == ([0],)
|
||||||
|
assert ([0],) != ([1],)
|
||||||
|
|
Loading…
Reference in New Issue