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

Commit

Permalink
[NF] Fix typing of dimensions.
Browse files Browse the repository at this point in the history
- Use Dimension.fromExp when evaluating an expression dimension in
  Typing.typeDimension instead of just putting the evaluated expression
  back, since the whole point is to get rid of such dimensions.

Belonging to [master]:
  - #2709
  • Loading branch information
perost authored and OpenModelica-Hudson committed Oct 9, 2018
1 parent 6127ec9 commit 00d7528
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Compiler/NFFrontEnd/NFDimension.mo
Expand Up @@ -101,7 +101,7 @@ public
fail();
end match;

else Dimension.EXP(exp, var);
else EXP(exp, var);
end match;
end fromExp;

Expand Down
8 changes: 4 additions & 4 deletions Compiler/NFFrontEnd/NFTyping.mo
Expand Up @@ -618,15 +618,15 @@ algorithm
end match;

// Make sure the dimension is constant evaluted, and also mark it as structural.
() := match dim
dim := match dim
case Dimension.EXP(exp = exp)
algorithm
Inst.markStructuralParamsExp(exp);
dim.exp := Ceval.evalExp(exp, Ceval.EvalTarget.DIMENSION(component, index, exp, info));
exp := Ceval.evalExp(exp, Ceval.EvalTarget.DIMENSION(component, index, exp, info));
then
();
Dimension.fromExp(exp, dim.var);

else ();
else dim;
end match;

arrayUpdate(dimensions, index, dim);
Expand Down

0 comments on commit 00d7528

Please sign in to comment.