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

Commit 8f80b4e

Browse files
sjoelundOpenModelica-Hudson
authored andcommitted
[NF] Support default attributes in functions
The previous code only worked for variables with some attributes set but failed for the default attributes. Belonging to [master]: - #2008
1 parent 6376982 commit 8f80b4e

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

Compiler/NFFrontEnd/NFFunction.mo

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -794,10 +794,18 @@ protected
794794
InnerOuter io;
795795
Visibility vis;
796796
algorithm
797-
Component.Attributes.ATTRIBUTES(
797+
_ := match Component.getAttributes(InstNode.component(component))
798+
case Component.Attributes.DEFAULT()
799+
algorithm
800+
direction := Direction.NONE;
801+
cty := ConnectorType.POTENTIAL;
802+
io := InnerOuter.NOT_INNER_OUTER;
803+
then ();
804+
case Component.Attributes.ATTRIBUTES(
798805
connectorType = cty,
799806
direction = direction,
800-
innerOuter = io) := Component.getAttributes(InstNode.component(component));
807+
innerOuter = io) then ();
808+
end match;
801809
vis := InstNode.visibility(component);
802810

803811
// Function components may not be connectors.

0 commit comments

Comments
 (0)