From 2d43fff7b38db39c3923de2f880694b1c03b2aca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Del=20Pino?= <stephane.delpino44@gmail.com> Date: Thu, 30 Jun 2022 07:26:50 +0200 Subject: [PATCH] Fix affectation of R^d and R^dxd tuples from a single 0 --- .../ast/ASTNodeListAffectationExpressionBuilder.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/language/ast/ASTNodeListAffectationExpressionBuilder.cpp b/src/language/ast/ASTNodeListAffectationExpressionBuilder.cpp index 8d77e1044..5ec9c7845 100644 --- a/src/language/ast/ASTNodeListAffectationExpressionBuilder.cpp +++ b/src/language/ast/ASTNodeListAffectationExpressionBuilder.cpp @@ -561,6 +561,8 @@ ASTNodeListAffectationExpressionBuilder::_buildAffectationProcessor( if (rhs_type == ASTNodeDataType::vector_t) { Assert(rhs_type.dimension() == 2); list_affectation_processor->template add<std::vector<TinyVector<2>>, TinyVector<2>>(value_node); + } else if (rhs_type == ASTNodeDataType::int_t) { + list_affectation_processor->template add<std::vector<TinyVector<2>>, int64_t>(value_node); } else { // LCOV_EXCL_START throw UnexpectedError("incompatible tuple types in affectation"); @@ -572,6 +574,8 @@ ASTNodeListAffectationExpressionBuilder::_buildAffectationProcessor( if (rhs_type == ASTNodeDataType::vector_t) { Assert(rhs_type.dimension() == 3); list_affectation_processor->template add<std::vector<TinyVector<3>>, TinyVector<3>>(value_node); + } else if (rhs_type == ASTNodeDataType::int_t) { + list_affectation_processor->template add<std::vector<TinyVector<3>>, int64_t>(value_node); } else { // LCOV_EXCL_START throw UnexpectedError("incompatible tuple types in affectation"); @@ -615,6 +619,8 @@ ASTNodeListAffectationExpressionBuilder::_buildAffectationProcessor( Assert(rhs_type.numberOfRows() == 2); Assert(rhs_type.numberOfColumns() == 2); list_affectation_processor->template add<std::vector<TinyMatrix<2>>, TinyMatrix<2>>(value_node); + } else if (rhs_type == ASTNodeDataType::int_t) { + list_affectation_processor->template add<std::vector<TinyMatrix<2>>, int64_t>(value_node); } else { // LCOV_EXCL_START throw UnexpectedError("incompatible tuple types in affectation"); @@ -627,6 +633,8 @@ ASTNodeListAffectationExpressionBuilder::_buildAffectationProcessor( Assert(rhs_type.numberOfRows() == 3); Assert(rhs_type.numberOfColumns() == 3); list_affectation_processor->template add<std::vector<TinyMatrix<3>>, TinyMatrix<3>>(value_node); + } else if (rhs_type == ASTNodeDataType::int_t) { + list_affectation_processor->template add<std::vector<TinyMatrix<3>>, int64_t>(value_node); } else { // LCOV_EXCL_START throw UnexpectedError("incompatible tuple types in affectation"); -- GitLab