Skip to content

Commit

Permalink
Handle redeclared classes in InstNode.isUserdefinedClass (#9932)
Browse files Browse the repository at this point in the history
  • Loading branch information
perost committed Dec 12, 2022
1 parent e3ba12f commit f9b0a53
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions OMCompiler/Compiler/NFFrontEnd/NFInstNode.mo
Expand Up @@ -360,13 +360,16 @@ uniontype InstNode
function isUserdefinedClass
input InstNode node;
output Boolean isUserdefined;
protected
InstNodeType ty;
algorithm
isUserdefined := match node
case CLASS_NODE()
then match node.nodeType
case CLASS_NODE(nodeType = ty)
then match ty
case InstNodeType.NORMAL_CLASS() then true;
case InstNodeType.BASE_CLASS() then true;
case InstNodeType.DERIVED_CLASS() then true;
case InstNodeType.REDECLARED_CLASS() then isUserdefinedClass(ty.parent);
else false;
end match;
else false;
Expand Down

0 comments on commit f9b0a53

Please sign in to comment.