From 6a18ae48b33c345185a8eda49e93adb1fb4594a9 Mon Sep 17 00:00:00 2001 From: Charles Brunet Date: Mon, 28 Aug 2023 11:42:55 -0400 Subject: [PATCH] ast: fully resolve nodes for add operation Otherwise, string + stringmethod results in a list of two strings instead of the concatenation of the strings --- mesonbuild/ast/interpreter.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mesonbuild/ast/interpreter.py b/mesonbuild/ast/interpreter.py index da2119c89..c51af09f4 100644 --- a/mesonbuild/ast/interpreter.py +++ b/mesonbuild/ast/interpreter.py @@ -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: