Skip to content

Commit

Permalink
[NF] Improve Expression.nthRecordElement.
Browse files Browse the repository at this point in the history
- Handle nthRecordElement of a record element of an array of records.
  • Loading branch information
perost committed Oct 15, 2019
1 parent 261032c commit fa2931a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions OMCompiler/Compiler/NFFrontEnd/NFExpression.mo
Expand Up @@ -4940,6 +4940,13 @@ public
then
makeArray(Type.setArrayElementType(recordExp.ty, Expression.typeOf(listHead(expl))), expl);

case RECORD_ELEMENT(ty = Type.ARRAY(elementType = Type.COMPLEX(cls = node)))
algorithm
node := Class.nthComponent(index, InstNode.getClass(node));
then
RECORD_ELEMENT(recordExp, index, InstNode.name(node),
Type.liftArrayLeftList(InstNode.getType(node), Type.arrayDims(recordExp.ty)));

else
algorithm
Type.COMPLEX(cls = node) := typeOf(recordExp);
Expand Down

0 comments on commit fa2931a

Please sign in to comment.