From d8ccb645b76a9d2a0dc93a871a6b8975410ca86f Mon Sep 17 00:00:00 2001 From: Josselin Date: Sun, 19 Jul 2020 15:17:40 +0200 Subject: [PATCH] Improve type support for tuple (fix #529) --- slither/visitors/slithir/expression_to_slithir.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/slither/visitors/slithir/expression_to_slithir.py b/slither/visitors/slithir/expression_to_slithir.py index 69fb2a980..80e36bce0 100644 --- a/slither/visitors/slithir/expression_to_slithir.py +++ b/slither/visitors/slithir/expression_to_slithir.py @@ -115,11 +115,14 @@ class ExpressionToSlithIR(ExpressionVisitor): set_val(expression, None) else: assert isinstance(right, TupleVariable) + tuple_types = [] for idx in range(len(left)): if not left[idx] is None: operation = Unpack(left[idx], right, idx) operation.set_expression(expression) + tuple_types.append(left[idx].type) self._result.append(operation) + right.set_type(tuple_types) set_val(expression, None) else: # Init of array, like