File tree Expand file tree Collapse file tree 3 files changed +24
-0
lines changed
OMCompiler/Compiler/NFFrontEnd
testsuite/flattening/modelica/scodeinst Expand file tree Collapse file tree 3 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -2360,6 +2360,11 @@ protected
23602360 Absyn . Exp aexp;
23612361 list< Absyn . Exp > args;
23622362algorithm
2363+ if InstContext . inRedeclared(context) then
2364+ // Don't update the binding if the parameter is being redeclared.
2365+ return ;
2366+ end if ;
2367+
23632368 comp := InstNode . component(node);
23642369
23652370 if not Component . isFixed(comp) or InstNode . hasBinding(node) then
Original file line number Diff line number Diff line change @@ -1184,6 +1184,7 @@ UnboundParameter3.mo \
11841184UnboundParameter4.mo \
11851185UnboundParameter5.mo \
11861186UnboundParameter6.mo \
1187+ UnboundParameter7.mo \
11871188usertype1.mo \
11881189usertype2.mo \
11891190usertype3.mo \
Original file line number Diff line number Diff line change 1+ // name: UnboundParameter7
2+ // keywords:
3+ // status: correct
4+ //
5+
6+ model A
7+ replaceable parameter Real x(start = 1.0 );
8+ end A;
9+
10+ model UnboundParameter7
11+ extends A(redeclare Real x = 1.0 );
12+ end UnboundParameter7;
13+
14+ // Result:
15+ // class UnboundParameter7
16+ // parameter Real x(start = 1.0) = 1.0;
17+ // end UnboundParameter7;
18+ // endResult
You can’t perform that action at this time.
0 commit comments