diff --git a/src/language/utils/AffectationProcessorBuilder.hpp b/src/language/utils/AffectationProcessorBuilder.hpp index 0e4b7ace65654b650989e817dbe2e4a545ae320f..4c489e7260836803e33440f6463e9e753244e593 100644 --- a/src/language/utils/AffectationProcessorBuilder.hpp +++ b/src/language/utils/AffectationProcessorBuilder.hpp @@ -17,9 +17,10 @@ class AffectationProcessorBuilder final : public IAffectationProcessorBuilder std::unique_ptr<INodeProcessor> getNodeProcessor(ASTNode& lhs_node, ASTNode& rhs_node) const final { - if constexpr (std::is_same_v<ValueT, TinyVector<1>> and std::is_same_v<DataT, int64_t> and + if constexpr ((std::is_same_v<ValueT, TinyVector<1>> or + std::is_same_v<ValueT, TinyMatrix<1>>)and std::is_same_v<DataT, int64_t> and std::is_same_v<OperatorT, language::eq_op>) { - // Special treatment for the case 0 -> R^1 + // Special treatment for the case 0 -> R^1 or 0 -> R^1x1 if ((rhs_node.is_type<language::integer>()) and (std::stoi(rhs_node.string()) == 0)) { return std::make_unique<AffectationFromZeroProcessor<ValueT>>(lhs_node); } else { diff --git a/tests/test_ASTNodeListAffectationExpressionBuilder.cpp b/tests/test_ASTNodeListAffectationExpressionBuilder.cpp index 8d495053e0d0e09b67c103a4f387ecf6afc018bf..7210b65f297cbcb9b3fa2bfd87c1370df90c71f5 100644 --- a/tests/test_ASTNodeListAffectationExpressionBuilder.cpp +++ b/tests/test_ASTNodeListAffectationExpressionBuilder.cpp @@ -239,7 +239,7 @@ let (x1,x2,x3,x) : R^1x1*R^2x2*R^3x3*R, std::string_view result = R"( (root:ASTNodeListProcessor) - +-(language::eq_op:AffectationProcessor<language::eq_op, TinyMatrix<1ul, 1ul, double>, long>) + +-(language::eq_op:AffectationFromZeroProcessor<TinyMatrix<1ul, 1ul, double> >) | +-(language::name:a:NameProcessor) | `-(language::integer:0:ValueProcessor) +-(language::eq_op:AffectationToTinyMatrixFromListProcessor<language::eq_op, TinyMatrix<2ul, 2ul, double> >)