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

Commit 8089bfd

Browse files
perostOpenModelica-Hudson
authored andcommitted
[NF] Fix package constant detection.
Belonging to [master]: - #2567
1 parent 52c826a commit 8089bfd

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

Compiler/NFFrontEnd/NFComponentRef.mo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,7 @@ public
677677
output Boolean isPkgConst;
678678
algorithm
679679
isPkgConst := match cref
680-
case CREF(node = InstNode.CLASS_NODE(nodeType = InstNodeType.NORMAL_CLASS())) then true;
680+
case CREF(node = InstNode.CLASS_NODE()) then InstNode.isUserdefinedClass(cref.node);
681681
case CREF(origin = Origin.CREF) then isPackageConstant(cref.restCref);
682682
else false;
683683
end match;

Compiler/NFFrontEnd/NFInstNode.mo

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,22 @@ uniontype InstNode
331331
end match;
332332
end isBaseClass;
333333

334+
function isUserdefinedClass
335+
input InstNode node;
336+
output Boolean isUserdefined;
337+
algorithm
338+
isUserdefined := match node
339+
case CLASS_NODE()
340+
then match node.nodeType
341+
case InstNodeType.NORMAL_CLASS() then true;
342+
case InstNodeType.BASE_CLASS() then true;
343+
case InstNodeType.DERIVED_CLASS() then true;
344+
else false;
345+
end match;
346+
else false;
347+
end match;
348+
end isUserdefinedClass;
349+
334350
function isComponent
335351
input InstNode node;
336352
output Boolean isComponent;

0 commit comments

Comments
 (0)