File tree Expand file tree Collapse file tree 3 files changed +24
-1
lines changed
OMCompiler/Compiler/NFFrontEnd Expand file tree Collapse file tree 3 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -2225,7 +2225,9 @@ algorithm
22252225
22262226 case Type . COMPLEX (complexTy = ComplexType . RECORD (node))
22272227 // Make sure it's really a record, and not e.g. a record inherited by a model.
2228- guard InstNode . isRecord(node)
2228+ // TODO: This check should really be InstNode.isRecord(node), but that
2229+ // causes issues with e.g. ComplexInput/ComplexOutput.
2230+ guard not InstNode . isModel(node)
22292231 algorithm
22302232 instRecordConstructor(node);
22312233 then
Original file line number Diff line number Diff line change @@ -1611,6 +1611,17 @@ uniontype InstNode
16111611 case COMPONENT_NODE () then isRecord(Component . classInstance(Pointer . access(node. component)));
16121612 end match;
16131613 end isRecord;
1614+
1615+ function isModel
1616+ input InstNode node;
1617+ output Boolean isModel;
1618+ algorithm
1619+ isModel := match node
1620+ case CLASS_NODE () then Restriction . isModel(Class . restriction(Pointer . access(node. cls)));
1621+ case COMPONENT_NODE () then isModel(Component . classInstance(Pointer . access(node. component)));
1622+ else false ;
1623+ end match;
1624+ end isModel;
16141625end InstNode ;
16151626
16161627annotation(__OpenModelica_Interface= "frontend" );
Original file line number Diff line number Diff line change @@ -196,6 +196,16 @@ public
196196 end match;
197197 end isClock;
198198
199+ function isModel
200+ input Restriction res;
201+ output Boolean isModel;
202+ algorithm
203+ isModel := match res
204+ case MODEL () then true ;
205+ else false ;
206+ end match;
207+ end isModel;
208+
199209 function toString
200210 input Restriction res;
201211 output String str;
You can’t perform that action at this time.
0 commit comments