[rational] insertion in a rational fixed. 63/17763/3
Cedric Delamarre [Wed, 3 Feb 2016 15:08:41 +0000 (16:08 +0100)]
test_run overloading rational

Change-Id: I4c14c203e1d21a61c88621de3dc12d28de43cbe2

scilab/modules/ast/src/cpp/ast/visitor_common.cpp
scilab/modules/overloading/tests/unit_tests/rational.dia.ref
scilab/modules/polynomials/sci_gateway/cpp/sci_simp.cpp

index e84e7ee..864850c 100644 (file)
@@ -1796,7 +1796,7 @@ types::InternalType* insertionCall(const ast::Exp& e, types::typed_list* _pArgs,
         {
             pOut = _pVar->getAs<types::Struct>()->insert(_pArgs, _pInsert);
         }
-        else if (_pVar->isGenericType())
+        else if (_pInsert->isGenericType() && (_pInsert->isTList() == false &&  _pInsert->isMList() == false))
         {
             pOut = _pVar->getAs<types::GenericType>()->remove(_pArgs);
         }
@@ -1834,7 +1834,7 @@ types::InternalType* insertionCall(const ast::Exp& e, types::typed_list* _pArgs,
         }
         else
         {
-            if (_pInsert->isGenericType())
+            if (_pInsert->isGenericType() && (_pInsert->isTList() == false &&  _pInsert->isMList() == false))
             {
                 pOut = _pInsert->getAs<types::GenericType>()->insertNew(_pArgs);
             }
index f3c3864..20212d3 100644 (file)
@@ -5,7 +5,7 @@
 //  This file is distributed under the same license as the Scilab package.
 // =============================================================================
 // <-- CLI SHELL MODE -->
-s=poly(0,'s');
+s=poly(0,"s");
 z = s^0;
 h=1/(2*s);
 assert_checkequal(size(h), [1 1]);
index 3a4c439..889a4da 100644 (file)
@@ -122,8 +122,8 @@ types::Function::ReturnValue sci_simp(types::typed_list &in, int _iRetCount, typ
                     return types::Function::Error;
                 }
 
-                types::Polynom* pPolyNumOut = new types::Polynom(wstrName, pNum->getRows(), pNum->getCols());
-                types::Polynom* pPolyDenOut = new types::Polynom(wstrName, pNum->getRows(), pNum->getCols());
+                types::Polynom* pPolyNumOut = new types::Polynom(wstrName, pNum->getDims(), pNum->getDimsArray());
+                types::Polynom* pPolyDenOut = new types::Polynom(wstrName, pNum->getDims(), pNum->getDimsArray());
 
                 iMaxDegrNum = pNum->getMaxRank();
                 iMaxDegrDen = pDen->getMaxRank();