From 68f1f512f67c35d26b09b36b0c50f20e753519f9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Hermes=29?=
 <stephane.adjemian@univ-lemans.fr>
Date: Thu, 25 Feb 2016 16:50:01 +0100
Subject: [PATCH] Fixed bug (implicit loops in subsasgn).

---
 src/@dseries/subsasgn.m                                      | 2 +-
 src/utilities/variables/build_list_of_variables_with_loops.m | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/@dseries/subsasgn.m b/src/@dseries/subsasgn.m
index 2564e48..3bad7d0 100644
--- a/src/@dseries/subsasgn.m
+++ b/src/@dseries/subsasgn.m
@@ -52,7 +52,7 @@ switch length(S)
                   error(['dseries::subsasgn: You cannot use implicit loops and regular expressions in the same rule!'])
               end
               if ~isempty(idArobase)
-                  elements = build_list_of_variables_with_loops(A.name, idArobase, element, {});
+                  elements = build_list_of_variables_with_loops({}, idArobase, element, {});
                   S(1).subs = replace_object_in_a_one_dimensional_cell_array(S(1).subs, elements(:), i);
               end
               if ~isempty(idBracket.open)
diff --git a/src/utilities/variables/build_list_of_variables_with_loops.m b/src/utilities/variables/build_list_of_variables_with_loops.m
index b85e799..4756209 100644
--- a/src/utilities/variables/build_list_of_variables_with_loops.m
+++ b/src/utilities/variables/build_list_of_variables_with_loops.m
@@ -17,7 +17,7 @@ function list_of_variables = build_list_of_variables_with_loops(o_list_of_variab
 % You should have received a copy of the GNU General Public License
 % along with Dynare.  If not, see <http://www.gnu.org/licenses/>.
 
-checknames = isempty(o_list_of_variables);
+checknames = ~isempty(o_list_of_variables);
     
 NumberOfImplicitLoops = .5*length(idArobase);
 
-- 
GitLab