From 8313cd5ec7d68cefa729ed73feb771a31493481a Mon Sep 17 00:00:00 2001
From: Johannes Pfeifer <jpfeifer@gmx.de>
Date: Tue, 10 Dec 2024 12:18:27 +0100
Subject: [PATCH] :bug: subst_auxvar.m: account for auxiliary type 5

Fixes crashes in model_info with differentiate_forward_vars
---
 matlab/subst_auxvar.m                                         | 4 ++--
 .../differentiate_forward_vars/RBC_differentiate_forward.mod  | 1 +
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/matlab/subst_auxvar.m b/matlab/subst_auxvar.m
index ec266e2f48..2f7bb75f6e 100644
--- a/matlab/subst_auxvar.m
+++ b/matlab/subst_auxvar.m
@@ -59,8 +59,8 @@ if ~isempty(aux_index)
             % Expectation operator
             str = sprintf('%s', M_.aux_vars(aux_index).orig_expr);
             return
-        case 6
-            % Ramsey's multipliers
+        case {5,6}
+            % differentiate_forward_vars and Ramsey multipliers
             if ~isempty(aux_lead_lag)
                 str = sprintf('%s(%d)', M_.endo_names{M_.aux_vars(aux_index).endo_index}, aux_lead_lag);
             else
diff --git a/tests/differentiate_forward_vars/RBC_differentiate_forward.mod b/tests/differentiate_forward_vars/RBC_differentiate_forward.mod
index d396e38c86..c124fe3f41 100644
--- a/tests/differentiate_forward_vars/RBC_differentiate_forward.mod
+++ b/tests/differentiate_forward_vars/RBC_differentiate_forward.mod
@@ -88,6 +88,7 @@ end;
 
 steady;
 check;
+model_info;
 
 perfect_foresight_setup(periods=500);
 perfect_foresight_solver;
-- 
GitLab