Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Store the scope of a dimension in raw dimensions so that redeclared dimensions can be instantiated in the correct scope.
- Loading branch information
Showing
5 changed files
with
55 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,6 +49,7 @@ public | |
|
||
record RAW_DIM | ||
Absyn.Subscript dim; | ||
InstNode scope; | ||
end RAW_DIM; | ||
|
||
record UNTYPED | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// name: RedeclareDim1 | ||
// keywords: redeclare | ||
// status: correct | ||
// cflags: -d=newInst | ||
// | ||
|
||
model A | ||
Real x[:]; | ||
end A; | ||
|
||
model RedeclareDim1 | ||
parameter Integer n = 3; | ||
A a(redeclare Real x[n]); | ||
end RedeclareDim1; | ||
|
||
// Result: | ||
// class RedeclareDim1 | ||
// final parameter Integer n = 3; | ||
// Real a.x[1]; | ||
// Real a.x[2]; | ||
// Real a.x[3]; | ||
// end RedeclareDim1; | ||
// 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// name: RedeclareDim2 | ||
// keywords: redeclare | ||
// status: correct | ||
// cflags: -d=newInst | ||
// | ||
|
||
package P | ||
type RealArray = Real[:]; | ||
end P; | ||
|
||
model RedeclareDim2 | ||
parameter Integer n = 3; | ||
package MP = P(redeclare type RealArray = Real[n]); | ||
MP.RealArray x; | ||
end RedeclareDim2; | ||
|
||
// Result: | ||
// class RedeclareDim2 | ||
// final parameter Integer n = 3; | ||
// Real x[1]; | ||
// Real x[2]; | ||
// Real x[3]; | ||
// end RedeclareDim2; | ||
// endResult |