Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix array constructor simplification (#11391)
- The simplification of array constructors where the iterator was only used to subscript array expressions also triggered for expressions that didn't use the iterator at all, simplify the check to only check for e.g. `{1, 2, 3}[i]`. Fixes #11385
- Loading branch information
Showing
8 changed files
with
59 additions
and
33 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
18 changes: 18 additions & 0 deletions
18
testsuite/flattening/modelica/scodeinst/BuiltinAttribute23.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,18 @@ | ||
// name: BuiltinAttribute23 | ||
// keywords: | ||
// status: correct | ||
// cflags: -d=newInst --newBackend | ||
// | ||
|
||
model BuiltinAttribute23 | ||
parameter Real x0; | ||
type T = Real[3] (each start = x0); | ||
T t; | ||
end BuiltinAttribute23; | ||
|
||
// Result: | ||
// class BuiltinAttribute23 | ||
// parameter Real x0; | ||
// Real[3] t(start = array(x0 for $t1 in 1:3)); | ||
// end BuiltinAttribute23; | ||
// 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
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