Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Belonging to [master]: - OpenModelica/OMCompiler#2969 - OpenModelica/OpenModelica-testsuite#1134
- Loading branch information
1 parent
b11b5d5
commit a10b195
Showing
2 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// name: RedeclareMod6 | ||
// keywords: | ||
// status: correct | ||
// cflags: -d=newInst | ||
// | ||
|
||
record BaseCable | ||
end BaseCable; | ||
|
||
record Generic | ||
extends BaseCable; | ||
end Generic; | ||
|
||
partial model PartialBaseLine | ||
replaceable parameter Generic commercialCable; | ||
end PartialBaseLine; | ||
|
||
partial model PartialNetwork | ||
replaceable parameter PartialGrid grid; | ||
replaceable PartialBaseLine[grid.nLinks] lines; | ||
end PartialNetwork; | ||
|
||
model Line | ||
extends PartialBaseLine; | ||
end Line; | ||
|
||
record PartialGrid | ||
parameter Integer nLinks; | ||
replaceable BaseCable[nLinks] cables; | ||
end PartialGrid; | ||
|
||
record TestGrid2Nodes | ||
extends PartialGrid(nLinks = 1); | ||
end TestGrid2Nodes; | ||
|
||
model RedeclareMod6 | ||
extends PartialNetwork( | ||
redeclare replaceable TestGrid2Nodes grid, | ||
redeclare Line lines(commercialCable = grid.cables)); | ||
end RedeclareMod6; | ||
|
||
// Result: | ||
// class RedeclareMod6 | ||
// parameter Integer grid.nLinks = 1; | ||
// end RedeclareMod6; | ||
// endResult |