| 1 | // name: InstClassBindingMod
|
|---|
| 2 | // keywords: declaration, binding, modification, bug2159
|
|---|
| 3 | // status: correct
|
|---|
| 4 | //
|
|---|
| 5 | // Checks that the instantiation does not reorder the elements of C1 when one
|
|---|
| 6 | // element is modified with a binding that references a class.
|
|---|
| 7 | //
|
|---|
| 8 |
|
|---|
| 9 | connector C1
|
|---|
| 10 | replaceable package P = .P;
|
|---|
| 11 | flow Real f;
|
|---|
| 12 | Real e;
|
|---|
| 13 | stream Real s;
|
|---|
| 14 | end C1;
|
|---|
| 15 |
|
|---|
| 16 | connector C2
|
|---|
| 17 | extends C1;
|
|---|
| 18 | end C2;
|
|---|
| 19 |
|
|---|
| 20 | package P
|
|---|
| 21 | constant Real x = 2.0;
|
|---|
| 22 | end P;
|
|---|
| 23 |
|
|---|
| 24 | model M1
|
|---|
| 25 | package P = .P;
|
|---|
| 26 | C2 c(redeclare package P = P);
|
|---|
| 27 | end M1;
|
|---|
| 28 |
|
|---|
| 29 | model InstClassBindingMod
|
|---|
| 30 | extends M1(c(e(start = P.x)));
|
|---|
| 31 | end InstClassBindingMod;
|
|---|
| 32 |
|
|---|
| 33 | // Result:
|
|---|
| 34 | // class InstClassBindingMod
|
|---|
| 35 | // Real c.f;
|
|---|
| 36 | // Real c.e(start = 2.0);
|
|---|
| 37 | // Real c.s;
|
|---|
| 38 | // equation
|
|---|
| 39 | // c.f = 0.0;
|
|---|
| 40 | // end InstClassBindingMod;
|
|---|
| 41 | // endResult
|
|---|