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)
1353
1353
Assignment (_lhs, _rhs)
1354
1354
end
1355
1355
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
+
1356
1363
function namespace_expr (
1357
1364
O, sys, n = nameof (sys); ivs = independent_variables (sys))
1358
1365
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
1360
1371
if any (isequal (O), ivs)
1361
1372
return O
1362
1373
elseif iscall (O)
@@ -1378,7 +1389,7 @@ function namespace_expr(
1378
1389
end
1379
1390
elseif isvariable (O)
1380
1391
renamespace (n, O)
1381
- elseif O isa Array
1392
+ elseif O isa AbstractArray && is_array_of_symbolics (O)
1382
1393
let sys = sys, n = n
1383
1394
map (o -> namespace_expr (o, sys, n; ivs), O)
1384
1395
end
You can’t perform that action at this time.
0 commit comments