Skip to content
This repository was archived by the owner on May 18, 2019. It is now read-only.

Commit e2321ae

Browse files
rfrankeOpenModelica-Hudson
authored andcommitted
[BE] Create array equations for array bindings
Belonging to [master]: - #2792 - OpenModelica/OpenModelica-testsuite#1078
1 parent a581f29 commit e2321ae

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Compiler/BackEnd/BackendDAECreate.mo

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -699,6 +699,7 @@ algorithm
699699
DAE.ComponentRef cr;
700700
DAE.ElementSource src;
701701
DAE.Exp e1, e2;
702+
DAE.Dimensions dims;
702703
BackendDAE.EquationAttributes attr;
703704
BackendDAE.Var var;
704705
list<BackendDAE.Equation> assert_eqs;
@@ -717,7 +718,12 @@ algorithm
717718
outVars := lowerDynamicVar(inElement, inFunctions) :: outVars;
718719
e1 := Expression.crefExp(cr);
719720
attr := BackendDAE.EQ_ATTR_DEFAULT_BINDING;
720-
outEqns := BackendDAE.EQUATION(e1, e2, src, attr) :: outEqns;
721+
(_, dims) := ComponentReference.crefTypeFull2(cr);
722+
if listEmpty(dims) then
723+
outEqns := BackendDAE.EQUATION(e1, e2, src, attr) :: outEqns;
724+
else
725+
outEqns := BackendDAE.ARRAY_EQUATION(Expression.dimensionsSizes(dims), e1, e2, src, attr) :: outEqns;
726+
end if;
721727
then
722728
();
723729

0 commit comments

Comments
 (0)