Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Make final components protected in record constructors. - Improve detection of package constants to avoid misdetection in record constructors. - Various minor fixes.
- Loading branch information
Showing
11 changed files
with
110 additions
and
19 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
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
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
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
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
52 changes: 52 additions & 0 deletions
52
testsuite/flattening/modelica/scodeinst/FunctionRecordArg4.mo
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,52 @@ | ||
// name: FunctionRecordArg4 | ||
// keywords: | ||
// status: correct | ||
// cflags: -d=newInst | ||
// | ||
|
||
record BaseR | ||
constant Integer n; | ||
final parameter Real x[n] = ones(n); | ||
end BaseR; | ||
|
||
function f | ||
input BaseR r; | ||
output Real x; | ||
algorithm | ||
x := r.x * r.x; | ||
end f; | ||
|
||
record R = BaseR(final n = 2); | ||
|
||
model FunctionRecordArg4 | ||
R r; | ||
Real x = f(r); | ||
end FunctionRecordArg4; | ||
|
||
// Result: | ||
// function BaseR "Automatically generated record constructor for BaseR" | ||
// input Integer n; | ||
// protected Real[n] x = fill(1.0, n); | ||
// output BaseR res; | ||
// end BaseR; | ||
// | ||
// function R "Automatically generated record constructor for R" | ||
// protected Integer n = 2; | ||
// protected Real[2] x = fill(1.0, n); | ||
// output R res; | ||
// end R; | ||
// | ||
// function f | ||
// input BaseR r; | ||
// output Real x; | ||
// algorithm | ||
// x := r.x * r.x; | ||
// end f; | ||
// | ||
// class FunctionRecordArg4 | ||
// final constant Integer r.n = 2; | ||
// final parameter Real r.x[1] = 1.0; | ||
// final parameter Real r.x[2] = 1.0; | ||
// Real x = f(r); | ||
// end FunctionRecordArg4; | ||
// endResult |
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