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

Commit 9cb312a

Browse files
perostOpenModelica-Hudson
authored andcommitted
Fix prefixing of modifiers on inherited elements.
Belonging to [master]: - #1997 - OpenModelica/OpenModelica-testsuite#773
1 parent 9b63a0e commit 9cb312a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Compiler/NFFrontEnd/NFInst.mo

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,12 @@ algorithm
785785
cls_tree := Class.classTree(InstNode.getClass(extendsNode));
786786
ClassTree.mapExtends(cls_tree, function modifyExtends(scope = extendsNode));
787787

788+
// Replace the node in the node type with the given scope, so that crefs found
789+
// in this extends are prefixed correctly.
788790
InstNodeType.BASE_CLASS(definition = elem) := InstNode.nodeType(extendsNode);
791+
extendsNode := InstNode.setNodeType(InstNodeType.BASE_CLASS(scope, elem), extendsNode);
792+
793+
// Create a modifier from the extends.
789794
ext_mod := Modifier.fromElement(elem, scope);
790795

791796
() := match elem
@@ -848,7 +853,7 @@ algorithm
848853
end if;
849854

850855
ClassTree.mapExtends(cls_tree,
851-
function instExtends(attributes = attributes, parent = parent, visibility = vis));
856+
function instExtends(attributes = attributes, parent = parent, visibility = vis));
852857

853858
ClassTree.applyLocalComponents(cls_tree,
854859
function instComponent(attributes = attributes, parent = node, scope = node));

0 commit comments

Comments
 (0)