Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix purity handling in typing of fill (#7498)
- Allow dimension arguments of fill to be impure or not fixed. - Fix logic in Prefixes.purityMin.
- Loading branch information
Showing
4 changed files
with
45 additions
and
6 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
37 changes: 37 additions & 0 deletions
37
testsuite/flattening/modelica/scodeinst/FuncBuiltinFill3.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,37 @@ | ||
// name: FuncBuiltinFill3 | ||
// keywords: fill | ||
// status: correct | ||
// cflags: -d=newInst | ||
// | ||
// Tests the builtin fill operator. | ||
// | ||
|
||
model FuncBuiltinFill3 | ||
parameter Integer a[:, :] = {{1}, {2}, {3}}; | ||
Real x[3, 3]; | ||
equation | ||
for i in 1:3 loop | ||
x[:, 1:i] = zeros(3, a[i, 1]+0); | ||
end for; | ||
end FuncBuiltinFill3; | ||
|
||
// Result: | ||
// class FuncBuiltinFill3 | ||
// parameter Integer a[1,1] = 1; | ||
// parameter Integer a[2,1] = 2; | ||
// parameter Integer a[3,1] = 3; | ||
// Real x[1,1]; | ||
// Real x[1,2]; | ||
// Real x[1,3]; | ||
// Real x[2,1]; | ||
// Real x[2,2]; | ||
// Real x[2,3]; | ||
// Real x[3,1]; | ||
// Real x[3,2]; | ||
// Real x[3,3]; | ||
// equation | ||
// x[:,1:1] = fill(0.0, 3, a[1,1]); | ||
// x[:,1:2] = fill(0.0, 3, a[2,1]); | ||
// x[:,:] = fill(0.0, 3, a[3,1]); | ||
// end FuncBuiltinFill3; | ||
// 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