Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Belonging to [master]: - OpenModelica/OMCompiler#2307 - OpenModelica/OpenModelica-testsuite#891
- Loading branch information
1 parent
71a15a1
commit a96f71d
Showing
3 changed files
with
54 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// name: RecordBinding1 | ||
// keywords: | ||
// status: correct | ||
// cflags: -d=newInst | ||
// | ||
|
||
record R | ||
Real x = 1.0; | ||
Real y = 2.0; | ||
Real z = 3.0; | ||
end R; | ||
|
||
model RecordBinding1 | ||
R r = R(4.0, 5.0); | ||
end RecordBinding1; | ||
|
||
// Result: | ||
// class RecordBinding1 | ||
// Real r.x = 4.0; | ||
// Real r.y = 5.0; | ||
// Real r.z = 3.0; | ||
// end RecordBinding1; | ||
// 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,29 @@ | ||
// name: RecordBinding2 | ||
// keywords: | ||
// status: correct | ||
// cflags: -d=newInst | ||
// | ||
|
||
record R | ||
Real x = 1.0; | ||
Real y = 2.0; | ||
Real z = 3.0; | ||
end R; | ||
|
||
model RecordBinding2 | ||
R r[2] = {R(4.0, 5.0), R(6.0, 7.0)}; | ||
end RecordBinding2; | ||
|
||
// Result: | ||
// class RecordBinding2 | ||
// Real r[1].x; | ||
// Real r[1].y; | ||
// Real r[1].z; | ||
// Real r[2].x; | ||
// Real r[2].y; | ||
// Real r[2].z; | ||
// equation | ||
// r[1] = R.'constructor'.'$default'(4.0, 5.0, 3.0); | ||
// r[2] = R.'constructor'.'$default'(6.0, 7.0, 3.0); | ||
// end RecordBinding2; | ||
// endResult |