File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -1353,10 +1353,21 @@ function namespace_assignment(eq::Assignment, sys)
13531353 Assignment (_lhs, _rhs)
13541354end
13551355
1356+ function is_array_of_symbolics (x)
1357+ symbolic_type (x) == ArraySymbolic () && return true
1358+ symbolic_type (x) == ScalarSymbolic () && return false
1359+ x isa AbstractArray &&
1360+ any (y -> symbolic_type (y) != NotSymbolic () || is_array_of_symbolics (y), x)
1361+ end
1362+
13561363function namespace_expr (
13571364 O, sys, n = nameof (sys); ivs = independent_variables (sys))
13581365 O = unwrap (O)
1359- symbolic_type (O) == NotSymbolic () && return O
1366+ # Exceptions for arrays of symbolic and Ref of a symbolic, the latter
1367+ # of which shows up in broadcasts
1368+ if symbolic_type (O) == NotSymbolic () && ! (O isa AbstractArray) && ! (O isa Ref)
1369+ return O
1370+ end
13601371 if any (isequal (O), ivs)
13611372 return O
13621373 elseif iscall (O)
@@ -1378,7 +1389,7 @@ function namespace_expr(
13781389 end
13791390 elseif isvariable (O)
13801391 renamespace (n, O)
1381- elseif O isa Array
1392+ elseif O isa AbstractArray && is_array_of_symbolics (O)
13821393 let sys = sys, n = n
13831394 map (o -> namespace_expr (o, sys, n; ivs), O)
13841395 end
You can’t perform that action at this time.
0 commit comments