compiler: Fix comparison of tuples of lists

pull/1299/head
David Nadlinger 2019-03-31 02:16:17 +01:00
parent baf102dbb2
commit 990e0b7dd9
2 changed files with 7 additions and 1 deletions

View File

@ -1426,7 +1426,7 @@ class ARTIQIRGenerator(algorithm.Visitor):
for index in range(len(lhs.type.elts)):
lhs_elt = self.append(ir.GetAttr(lhs, 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:
result = elt_result
else:

View File

@ -5,3 +5,9 @@ x, y = 2, 1
x, y = y, x
assert x == 1 and y == 2
assert (1, 2) + (3.0,) == (1, 2, 3.0)
assert (0,) == (0,)
assert (0,) != (1,)
assert ([0],) == ([0],)
assert ([0],) != ([1],)