You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/systems/model_parsing.jl
+7-4Lines changed: 7 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -511,9 +511,10 @@ function generate_var!(dict, a, b, varclass, mod;
511
511
end
512
512
513
513
# Use the `t` defined in the `mod`. When it is unavailable, generate a new `t` with a warning.
514
-
functionget_t(mod, t)
514
+
get_t(mod, t) =invokelatest(_get_t, mod, t)
515
+
function_get_t(mod, t)
515
516
try
516
-
get_var(mod, t)
517
+
_get_var(mod, t)
517
518
catch e
518
519
if e isa UndefVarError
519
520
@warn("Could not find a predefined `t` in `$mod`; generating a new one within this model.\nConsider defining it or importing `t` (or `t_nounits`, `t_unitful` as `t`) from ModelingToolkit.")
@@ -588,7 +589,8 @@ function set_var_metadata(a, ms)
588
589
a, metadata_with_exprs
589
590
end
590
591
591
-
functionget_var(mod::Module, b)
592
+
get_var(mod, b) =invokelatest(_get_var, mod, b)
593
+
function_get_var(mod::Module, b)
592
594
if b isa Symbol
593
595
isdefined(mod, b) &&returngetproperty(mod, b)
594
596
isdefined(@__MODULE__, b) &&returngetproperty(@__MODULE__, b)
0 commit comments