Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Further improve context check in typeCref (#8435)
- Loading branch information
Showing
6 changed files
with
83 additions
and
8 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
40 changes: 40 additions & 0 deletions
40
testsuite/flattening/modelica/scodeinst/RecordBinding11.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,40 @@ | ||
// name: RecordBinding11 | ||
// keywords: | ||
// status: correct | ||
// cflags: -d=newInst | ||
// | ||
|
||
package PartialMedium | ||
constant Real h_default = setState_pTX(); | ||
|
||
function setState_pTX | ||
output Real state; | ||
algorithm | ||
state := f(); | ||
end setState_pTX; | ||
|
||
record Coefficients | ||
constant Real[:, 4] res = ones(3, 4); | ||
end Coefficients; | ||
|
||
constant Coefficients coefficients; | ||
|
||
function f | ||
output Real delta; | ||
protected | ||
final constant Integer nRes = size(coefficients.res, 1); | ||
final constant Real[nRes, 4] b = coefficients.res; | ||
algorithm | ||
delta := sum(b[1, i] for i in 1:nRes); | ||
end f; | ||
end PartialMedium; | ||
|
||
model RecordBinding11 | ||
parameter Real h_start = PartialMedium.h_default; | ||
end RecordBinding11; | ||
|
||
// Result: | ||
// class RecordBinding11 | ||
// parameter Real h_start = 3.0; | ||
// end RecordBinding11; | ||
// endResult |