Skip to content

Commit 43ad267

Browse files
adrpoOpenModelica-Hudson
authored andcommitted
ticket:5144 do not expand complex array components
Belonging to [master]: - OpenModelica/OMCompiler#2682
1 parent b9307fb commit 43ad267

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Compiler/NFFrontEnd/NFFlatten.mo

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,18 @@ protected
524524
RangeIterator range_iter;
525525
Expression sub_exp;
526526
list<Subscript> subs;
527+
list<Variable> vrs;
527528
algorithm
529+
// if we don't scalarize flatten the class and then add dimensions to the types
530+
if not Flags.isSet(Flags.NF_SCALARIZE) then
531+
(vrs, sections) := flattenClass(cls, prefix, visibility, binding, {}, sections);
532+
for v in vrs loop
533+
v.ty := Type.liftArrayLeftList(v.ty, dimensions);
534+
vars := v::vars;
535+
end for;
536+
return;
537+
end if;
538+
528539
if listEmpty(dimensions) then
529540
subs := listReverse(subscripts);
530541
sub_pre := ComponentRef.setSubscripts(subs, prefix);

0 commit comments

Comments
 (0)