Improve type support for tuple (fix #529)

pull/536/head
Josselin 4 years ago
parent 7f06947601
commit d8ccb645b7
  1. 3
      slither/visitors/slithir/expression_to_slithir.py

@ -115,11 +115,14 @@ class ExpressionToSlithIR(ExpressionVisitor):
set_val(expression, None) set_val(expression, None)
else: else:
assert isinstance(right, TupleVariable) assert isinstance(right, TupleVariable)
tuple_types = []
for idx in range(len(left)): for idx in range(len(left)):
if not left[idx] is None: if not left[idx] is None:
operation = Unpack(left[idx], right, idx) operation = Unpack(left[idx], right, idx)
operation.set_expression(expression) operation.set_expression(expression)
tuple_types.append(left[idx].type)
self._result.append(operation) self._result.append(operation)
right.set_type(tuple_types)
set_val(expression, None) set_val(expression, None)
else: else:
# Init of array, like # Init of array, like

Loading…
Cancel
Save