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

Commit 33c5dba

Browse files
perostOpenModelica-Hudson
authored andcommitted
[NF] Fix checkConnectorType for derived nodes.
Belonging to [master]: - #2933
1 parent 1afef5f commit 33c5dba

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

Compiler/NFFrontEnd/NFConnectEquations.mo

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,12 @@ algorithm
9595
case ConnectorType.POTENTIAL then potfunc(set);
9696
case ConnectorType.FLOW then generateFlowEquations(set);
9797
case ConnectorType.STREAM then generateStreamEquations(set, flowThreshold);
98+
else
99+
algorithm
100+
Error.addInternalError("Invalid connector type on set "
101+
+ List.toString(set, Connector.toString, "", "{", ", ", "}", true), sourceInfo());
102+
then
103+
fail();
98104
end match;
99105

100106
equations := listAppend(set_eql, equations);

Compiler/NFFrontEnd/NFTyping.mo

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -457,12 +457,14 @@ end checkComponentAttributes;
457457
function checkConnectorType
458458
input InstNode node;
459459
output Boolean isConnector;
460+
protected
461+
InstNode dnode = InstNode.getDerivedNode(node);
460462
algorithm
461-
if InstNode.isEmpty(node) or InstNode.isInnerOuterNode(node) then
463+
if InstNode.isEmpty(dnode) or InstNode.isInnerOuterNode(dnode) then
462464
isConnector := false;
463465
else
464-
isConnector := Class.isConnectorClass(InstNode.getClass(node)) or
465-
checkConnectorType(InstNode.parent(node));
466+
isConnector := Class.isConnectorClass(InstNode.getClass(dnode)) or
467+
checkConnectorType(InstNode.parent(dnode));
466468
end if;
467469
end checkConnectorType;
468470

0 commit comments

Comments
 (0)