* Bug 16122 fixed: now concat polynomials with <> var raises an error
[scilab.git] / scilab / modules / ast / src / cpp / ast / visitor_common.cpp
index 3e3ead4..e5a924d 100644 (file)
@@ -486,6 +486,11 @@ types::InternalType* AddElementToVariable(types::InternalType* _poDest, types::I
                 poResult->getAs<types::Double>()->append(iCurRow, iCurCol, _poSource);
                 break;
             case types::InternalType::ScilabPolynom:
+                if (poResult->getAs<types::Polynom>()->getVariableName() !=  _poSource->getAs<types::Polynom>()->getVariableName())
+                {
+                    // call overload
+                    return NULL;
+                }
                 poResult->getAs<types::Polynom>()->append(iCurRow, iCurCol, _poSource);
                 break;
             case types::InternalType::ScilabBool: