From 10e131739a45d181be0b110d70290b2c1160da80 Mon Sep 17 00:00:00 2001 From: thorek1 Date: Sat, 20 Jan 2024 13:00:32 +0000 Subject: [PATCH] throw informative error if var defined only in ss --- src/macros.jl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/macros.jl b/src/macros.jl index 2edd69cf..dc299647 100644 --- a/src/macros.jl +++ b/src/macros.jl @@ -646,7 +646,11 @@ macro model(𝓂,ex...) dyn_var_past = sort(collect(reduce(union,dyn_var_past_list))) dyn_var_ss = sort(collect(reduce(union,dyn_ss_list))) - all_vars = union(dyn_var_future, dyn_var_present, dyn_var_past, dyn_var_ss) + all_dyn_vars = union(dyn_var_future, dyn_var_present, dyn_var_past) + + @assert length(setdiff(dyn_var_ss, all_dyn_vars)) == 0 "The following variables are (and cannot be) defined only in steady state (`[ss]`): $(setdiff(dyn_var_ss, all_dyn_vars))" + + all_vars = union(all_dyn_vars, dyn_var_ss) present_only = sort(setdiff(dyn_var_present,union(dyn_var_past,dyn_var_future))) future_not_past = sort(setdiff(dyn_var_future, dyn_var_past))