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

Commit

Permalink
[NF] Fix checkConnectorType for derived nodes.
Browse files Browse the repository at this point in the history
Belonging to [master]:
  - #2933
  • Loading branch information
perost authored and OpenModelica-Hudson committed Feb 14, 2019
1 parent 1afef5f commit 33c5dba
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
6 changes: 6 additions & 0 deletions Compiler/NFFrontEnd/NFConnectEquations.mo
Expand Up @@ -95,6 +95,12 @@ algorithm
case ConnectorType.POTENTIAL then potfunc(set);
case ConnectorType.FLOW then generateFlowEquations(set);
case ConnectorType.STREAM then generateStreamEquations(set, flowThreshold);
else
algorithm
Error.addInternalError("Invalid connector type on set "
+ List.toString(set, Connector.toString, "", "{", ", ", "}", true), sourceInfo());
then
fail();
end match;

equations := listAppend(set_eql, equations);
Expand Down
8 changes: 5 additions & 3 deletions Compiler/NFFrontEnd/NFTyping.mo
Expand Up @@ -457,12 +457,14 @@ end checkComponentAttributes;
function checkConnectorType
input InstNode node;
output Boolean isConnector;
protected
InstNode dnode = InstNode.getDerivedNode(node);
algorithm
if InstNode.isEmpty(node) or InstNode.isInnerOuterNode(node) then
if InstNode.isEmpty(dnode) or InstNode.isInnerOuterNode(dnode) then
isConnector := false;
else
isConnector := Class.isConnectorClass(InstNode.getClass(node)) or
checkConnectorType(InstNode.parent(node));
isConnector := Class.isConnectorClass(InstNode.getClass(dnode)) or
checkConnectorType(InstNode.parent(dnode));
end if;
end checkConnectorType;

Expand Down

0 comments on commit 33c5dba

Please sign in to comment.