Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Skip some crefs in Structural.isExpressionNotFixed (#9135)
- Skip iterators and any crefs that aren't referring to a node in `isExpressionNotFixed`, checking them will fail and isn't necessary since they can't be not fixed anyway.
- Loading branch information
Showing
3 changed files
with
47 additions
and
0 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
45 changes: 45 additions & 0 deletions
45
testsuite/flattening/modelica/scodeinst/RecordBinding12.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,45 @@ | ||
// name: RecordBinding12 | ||
// keywords: | ||
// status: correct | ||
// cflags: -d=newInst | ||
// | ||
|
||
record BaseR | ||
parameter E e; | ||
parameter Real m = 1; | ||
parameter Integer N = 1; | ||
parameter Real[N] H = {0}; | ||
end BaseR; | ||
|
||
record R | ||
extends BaseR( | ||
e = E.a, | ||
m = 1 + sum({H[k] for k in 1:N}), | ||
N = 4, | ||
H = {1, 2, 3, 4}); | ||
end R; | ||
|
||
type E = enumeration(a, b, c); | ||
|
||
model M | ||
parameter BaseR material; | ||
equation | ||
if material.e == E.b then | ||
end if; | ||
end M; | ||
|
||
model RecordBinding12 | ||
M m(material = R()); | ||
end RecordBinding12; | ||
|
||
// Result: | ||
// class RecordBinding12 | ||
// final parameter enumeration(a, b, c) m.material.e = E.a; | ||
// parameter Real m.material.m = 11.0; | ||
// final parameter Integer m.material.N = 4; | ||
// parameter Real m.material.H[1] = 1.0; | ||
// parameter Real m.material.H[2] = 2.0; | ||
// parameter Real m.material.H[3] = 3.0; | ||
// parameter Real m.material.H[4] = 4.0; | ||
// end RecordBinding12; | ||
// endResult |