Skip to content

Commit d44a4a0

Browse files
committed
[NF] Fix ExpandExp.expand for arrays.
- Fixed match pattern in ExpandExp.expand that was supposed to match arrays with at least two dimensions, but which instead matched arrays with exactly two dimensions.
1 parent 6192db4 commit d44a4a0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

OMCompiler/Compiler/NFFrontEnd/NFExpandExp.mo

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,16 @@ public
6060

6161
case Expression.CREF(ty = Type.ARRAY()) then expandCref(exp);
6262

63-
case Expression.ARRAY(ty = Type.ARRAY(dimensions = _ :: _ :: {}))
63+
// One-dimensional arrays are already expanded.
64+
case Expression.ARRAY(ty = Type.ARRAY(dimensions = {})) then (exp, true);
65+
66+
case Expression.ARRAY()
6467
algorithm
6568
(expl, expanded) := expandList(exp.elements);
6669
exp.elements := expl;
6770
then
6871
(exp, expanded);
6972

70-
case Expression.ARRAY() then (exp, true);
7173
case Expression.TYPENAME() then (expandTypename(exp.ty), true);
7274
case Expression.RANGE() then expandRange(exp);
7375
case Expression.CALL() then expandCall(exp.call, exp);

0 commit comments

Comments
 (0)