diff --git a/src/language/node_processor/ConcatExpressionProcessor.hpp b/src/language/node_processor/ConcatExpressionProcessor.hpp index bb6357c87124110e973730ff6fb3eb9d5fdde5a3..718325641d5cbb90a662c19021fddb73141f4ee8 100644 --- a/src/language/node_processor/ConcatExpressionProcessor.hpp +++ b/src/language/node_processor/ConcatExpressionProcessor.hpp @@ -16,11 +16,11 @@ class ConcatExpressionProcessor final : public INodeProcessor { if constexpr (std::is_same_v<B_DataT, std::string>) { return a + std::get<B_DataT>(b); - } else if constexpr (std::is_arithmetic_v<B_DataT>) { + } else if constexpr ((std::is_arithmetic_v<B_DataT>)and(not std::is_same_v<B_DataT, bool>)) { return a + std::to_string(std::get<B_DataT>(b)); } else { std::ostringstream os; - os << a << b; + os << a << std::boolalpha << b; return os.str(); } } diff --git a/tests/test_ConcatExpressionProcessor.cpp b/tests/test_ConcatExpressionProcessor.cpp index 4c5e202b71a1b9630683145aa4ffb30863ce9a27..7e8d097f998c367d8a583903e1ab6178348d56f2 100644 --- a/tests/test_ConcatExpressionProcessor.cpp +++ b/tests/test_ConcatExpressionProcessor.cpp @@ -74,7 +74,8 @@ TEST_CASE("ConcatExpressionProcessor", "[language]") SECTION("string + B") { - CHECK_CONCAT_EXPRESSION_RESULT(R"(let s:string, s = "foo_"; s = s+true;)", "s", std::string{"foo_1"}); + CHECK_CONCAT_EXPRESSION_RESULT(R"(let s:string, s = "foo_"; s = s+(2>1);)", "s", std::string{"foo_true"}); + CHECK_CONCAT_EXPRESSION_RESULT(R"(let s:string, s = "foo_"; s = s+(1>2);)", "s", std::string{"foo_false"}); } SECTION("string + R^1")