Skip to content

Commit 7dc71fa

Browse files
committed
fix ticket:5941, handle metarecords in bindings of function inputs and outputs
1 parent 68e8900 commit 7dc71fa

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

OMCompiler/Compiler/SimCode/SimCodeFunctionUtil.mo

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1439,12 +1439,17 @@ algorithm
14391439
list<SimCodeFunction.RecordDeclaration> accRecDecls;
14401440
DAE.Algorithm algorithm_;
14411441
list<DAE.Exp> expl;
1442+
Option<DAE.Exp> binding;
14421443

14431444
case ({}, accRecDecls, rt) then (accRecDecls, rt);
14441445

1445-
case (((DAE.VAR(ty = ft)) :: rest), accRecDecls, rt)
1446+
case (((DAE.VAR(ty = ft, binding = binding)) :: rest), accRecDecls, rt)
14461447
equation
14471448
(accRecDecls, rt_1) = elaborateRecordDeclarationsForRecord(ft, accRecDecls, rt);
1449+
if Util.isSome(binding) and Config.acceptMetaModelicaGrammar() then
1450+
(_, expl) = Expression.traverseExpBottomUp(Util.getOption(binding), matchMetarecordCalls, {});
1451+
(accRecDecls, rt_1) = elaborateRecordDeclarationsForMetarecords(expl, accRecDecls, rt_1);
1452+
end if;
14481453
(accRecDecls, rt_2) = elaborateRecordDeclarations(rest, accRecDecls, rt_1);
14491454
then
14501455
(accRecDecls, rt_2);
@@ -2559,6 +2564,7 @@ algorithm
25592564
else (inExp,itpl);
25602565
end matchcontinue;
25612566
end matchNonBuiltinCallsAndFnRefPaths;
2567+
25622568
protected function aliasRecordDeclarations
25632569
input SimCodeFunction.RecordDeclaration inDecl;
25642570
input HashTableStringToPath.HashTable inHt;

0 commit comments

Comments
 (0)