Skip to content

Commit

Permalink
Fix Component.isDeleted (#10589)
Browse files Browse the repository at this point in the history
  • Loading branch information
perost committed Apr 21, 2023
1 parent 67fe43c commit b22a39b
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 1 deletion.
1 change: 1 addition & 0 deletions OMCompiler/Compiler/NFFrontEnd/NFBinding.mo
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,7 @@ public
algorithm
isTyped := match binding
case TYPED_BINDING() then true;
case FLAT_BINDING() then true;
else false;
end match;
end isTyped;
Expand Down
2 changes: 1 addition & 1 deletion OMCompiler/Compiler/NFFrontEnd/NFComponent.mo
Original file line number Diff line number Diff line change
Expand Up @@ -879,7 +879,7 @@ public
Binding condition;

case COMPONENT(condition = condition)
then Binding.isBound(condition) and Expression.isFalse(Binding.getTypedExp(condition));
then Binding.isTyped(condition) and Expression.isFalse(Binding.getTypedExp(condition));

else false;
end match;
Expand Down
26 changes: 26 additions & 0 deletions testsuite/flattening/modelica/scodeinst/Condition9.mo
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// name: Condition9
// keywords:
// status: correct
// cflags: -d=newInst
//
//

connector C
Real x if false;
end C;

connector C2
C c if false;
end C2;

model Condition9
C2 c1;
C2 c2;
equation
connect(c1, c2);
end Condition9;

// Result:
// class Condition9
// end Condition9;
// endResult
1 change: 1 addition & 0 deletions testsuite/flattening/modelica/scodeinst/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ Condition5.mo \
Condition6.mo \
Condition7.mo \
Condition8.mo \
Condition9.mo \
ConditionInvalid1.mo \
ConditionInvalidBinding1.mo \
ConditionInvalidBinding2.mo \
Expand Down

0 comments on commit b22a39b

Please sign in to comment.