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

Commit

Permalink
Fix lookup of qualified crefs in nfinst.
Browse files Browse the repository at this point in the history
  • Loading branch information
perost authored and OpenModelica-Hudson committed Nov 28, 2016
1 parent e1efb57 commit 2ccad20
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
26 changes: 26 additions & 0 deletions Compiler/NFFrontEnd/NFComponent.mo
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,32 @@ uniontype Component
end match;
end classInstance;

function setClassInstance
input InstNode classInst;
input output Component component;
algorithm
() := match component
case UNTYPED_COMPONENT()
algorithm
component.classInst := classInst;
then
();

case TYPED_COMPONENT()
algorithm
component.classInst := classInst;
then
();

case EXTENDS_NODE()
algorithm
component.node := classInst;
then
();

end match;
end setClassInstance;

function setModifier
input Modifier modifier;
input output Component component;
Expand Down
5 changes: 5 additions & 0 deletions Compiler/NFFrontEnd/NFInst.mo
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ algorithm

// Instantiate, type and flatten the class.
cls := instantiate(cls, Modifier.NOMOD(), top_comp_node);

// Update the instantiated class inside the top component.
top_comp := Component.setClassInstance(cls, top_comp);
top_comp_node := ComponentNode.replaceComponent(top_comp, top_comp_node);

cls := Typing.typeClass(cls, top_comp_node);
dae := NFFlatten.flattenClass(cls);

Expand Down

0 comments on commit 2ccad20

Please sign in to comment.