Skip to content

Commit 348fef5

Browse files
committed
Better error message
1 parent 0cea545 commit 348fef5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/utils.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,10 @@ function mergedefaults(defaults, varmap, vars)
529529
end
530530
end
531531

532+
@noinline function throw_missingvars_in_sys(vars)
533+
throw(ArgumentError("$vars are either missing from the variable map or missing from the system's states/parameters list."))
534+
end
535+
532536
function promote_to_concrete(vs; tofloat = true, use_union = false)
533537
if isempty(vs)
534538
return vs
@@ -537,6 +541,8 @@ function promote_to_concrete(vs; tofloat = true, use_union = false)
537541
if Base.isconcretetype(T) && (!tofloat || T === float(T)) # nothing to do
538542
vs
539543
else
544+
sym_vs = filter(x->SymbolicUtils.issym(x) || SymbolicUtils.istree(x), vs)
545+
isempty(sym_vs) || throw_missingvars_in_sys(sym_vs)
540546
C = typeof(first(vs))
541547
I = Int8
542548
has_int = false

0 commit comments

Comments
 (0)