From 787fbc3b0df1bb305d0e0039ddf6c178e30253b8 Mon Sep 17 00:00:00 2001
From: Johannes Pfeifer <jpfeifer@gmx.de>
Date: Thu, 4 Nov 2021 09:04:26 +0100
Subject: [PATCH] Expand cryptic error message if a value is assigned a second
 time

(cherry picked from commit 4461544efdab77370c6981a6f7aceeffc29fd39f)
---
 dynare++/parser/cc/atom_assignings.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dynare++/parser/cc/atom_assignings.cc b/dynare++/parser/cc/atom_assignings.cc
index a3dc17a618..e719404630 100644
--- a/dynare++/parser/cc/atom_assignings.cc
+++ b/dynare++/parser/cc/atom_assignings.cc
@@ -147,7 +147,7 @@ AtomAssignings::add_assignment(int asgn_off, const string &str, int name_len,
   if (lname2expr.find(name) != lname2expr.end())
     {
       // Prevent the occurrence of #415
-      std::cerr << "Changing the value of " << name << " is not supported. Aborting." << std::endl;
+      std::cerr << "Changing the value of " << name << " through a second assignment (e.g. in initval) is not supported. Aborting." << std::endl;
       exit(EXIT_FAILURE);
     }
   lname2expr[name] = order.size()-1;
-- 
GitLab