ast: fully resolve nodes for add operation

Otherwise, string + stringmethod results in a list of two strings instead of the concatenation of the strings
This commit is contained in:
Charles Brunet 2023-08-28 11:42:55 -04:00
parent 11ef2a536c
commit 6a18ae48b3
1 changed files with 2 additions and 2 deletions

View File

@ -371,8 +371,8 @@ class AstInterpreter(InterpreterBase):
elif isinstance(node, ArithmeticNode):
if node.operation != 'add':
return None # Only handle string and array concats
l = quick_resolve(node.left)
r = quick_resolve(node.right)
l = self.resolve_node(node.left, include_unknown_args, id_loop_detect)
r = self.resolve_node(node.right, include_unknown_args, id_loop_detect)
if isinstance(l, str) and isinstance(r, str):
result = l + r # String concatenation detected
else: